]> git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/player_info.mako
Gridify the player and server info pages.
[xonotic/xonstat.git] / xonstat / templates / player_info.mako
1 <%inherit file="base.mako"/>
2 <%namespace name="nav" file="nav.mako" />
3 <%namespace file="accuracy.mako" import="accuracy" />
4
5 <%block name="navigation">
6 ${nav.nav('players')}
7 </%block>
8
9 <%block name="title">
10 Player Information
11 </%block>
12
13
14 % if player is None:
15 <h2>This player is so good we couldn't find him!</h2>
16 <p>Seriously though, he probably doesn't exist...just a figment of your imagination. Carry on then!</p>
17
18 % else:
19 <div class="row">
20   <div class="span5">
21     <h2>${player.nick_html_colors()|n}</h2>
22     <p>
23        Member Since: ${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')} <br />
24        Last Seen: ${recent_games[0][1].fuzzy_date()} <br />
25        Playing Time: ${game_stats['total_alivetime']} <br />
26        Games Played: ${game_stats['total_games_played']} <br />
27        Average Rank: ${game_stats['avg_rank']} <br />
28     </p>
29   </div>
30 </div>
31 % endif
32
33
34 % if game_stats:
35 <div class="row">
36   <div class="span12">
37     <h3>Overall Game Stats</h2>
38     <table class="table table-bordered table-condensed">
39       <thead>
40         <tr>
41           <th>Score</th>
42           <th>Carrier Kills</th>
43           <th>Kills</th>
44           <th>Collects</th>
45           <th>Deaths</th>
46           <th>Destroys</th>
47           <th>Suicides</th>
48           <th>Destroys (with key)</th>
49           <th>Captures</th>
50           <th>Pushes</th>
51           <th>Pickups</th>
52           <th>Pushed</th>
53           <th>Drops</th>
54           <th>Returns</th>
55         </tr>
56       </thead>
57       <tbody>
58         <tr>
59           <td>${game_stats['total_score']}</td>
60           <td>${game_stats['total_carrier_frags']}</td>
61           <td>${game_stats['total_kills']}</td>
62           <td>${game_stats['total_collects']}</td>
63           <td>${game_stats['total_deaths']}</td>
64           <td>${game_stats['total_destroys']}</td>
65           <td>${game_stats['total_suicides']}</td>
66           <td>${game_stats['total_destroys']}</td>
67           <td>${game_stats['total_captures']}</td>
68           <td>${game_stats['total_pushes']}</td>
69           <td>${game_stats['total_pickups']}</td>
70           <td>${game_stats['total_pushed']}</td>
71           <td>${game_stats['total_drops']}</td>
72           <td>${game_stats['total_returns']}</td>
73         </tr>
74       </tbody>
75     </table>
76     % endif
77   </div>
78 </div>
79
80
81 % if weapon_stats:
82 <div class="row">
83   <div class="span12">
84     <h3>Overall Accuracy</h3>
85     ${accuracy(weapon_stats)}
86   </div>
87 </div>
88 % endif
89
90
91 ##### RECENT GAMES (v2) ####
92 % if recent_games:
93 <div class="row">
94   <div class="span6">
95     <h3>Recent Games</h3>
96     <table class="table table-bordered table-condensed">
97       <thead>
98         <tr>
99            <th>Game Type</th>
100            <th>Map</th>
101            <th>Result</th>
102            <th>Played</th>
103            <th>Permalink</th>
104         </tr>
105       </thead>
106       <tbody>
107       % for (gamestat, game, server, map) in recent_games:
108         <tr>
109            <td><img title="${game.game_type_cd}" src="/static/images/icons/24x24/${game.game_type_cd}.png" alt="${game.game_type_cd}" /></td>
110            <td>${map.name}</td>
111            <td>
112            % if gamestat.team != None and gamestat.team == game.winner:
113            Won (#${gamestat.rank})
114            % elif gamestat.team != None and gamestat.team != game.winner:
115            Lost (#${gamestat.rank})
116                % else:
117                #${gamestat.rank}
118            % endif
119            </td>
120            <td>${game.fuzzy_date()}</td>
121            <td><a class="recent_game_box" href="${request.route_url("game_info", id=game.game_id)}" name="Game info page for game #${game.game_id}">View</a></td>
122         </tr>
123       % endfor
124       </tbody>
125     </table>
126     % if game_stats['total_games_played'] > 10:
127     <a href="${request.route_url("player_game_index", player_id=player.player_id, page=1)}" title="Game index for ${player.nick}">More games</a> played by ${player.nick_html_colors()|n}...
128     % endif
129   </div>
130 </div>
131 % endif