]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/player_info.mako
Reduce the operations in hex_repl for a small performance boost.
[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="span8">
21     <h2>${player.nick_html_colors()|n}</h2>
22     <p>
23        Member Since: <small>${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')} </small><br />
24        Last Seen: <small>${recent_games[0][1].fuzzy_date()} </small><br />
25        Playing Time: <small>${game_stats['total_alivetime']} </small><br />
26        <% games_breakdown_str = ', '.join(["{0} {1}".format(ng, gt) for (gt, ng) in games_breakdown]) %>
27        Games Played: <small>${total_games} (${games_breakdown_str})</small><br />
28        Average Rank: <small>${game_stats['avg_rank']} </small><br />
29        % if elos_display is not None and len(elos_display) > 0:
30        Elo:
31           <small>${', '.join(elos_display)} </small>
32           <br />
33           %if '*' in ', '.join(elos_display):
34               <small><i>*preliminary Elo</i></small>
35           %endif
36       % endif
37     </p>
38   </div>
39 </div>
40 % endif
41
42
43 % if game_stats:
44 <div class="row">
45   <div class="span12">
46     <h3>Overall Game Stats</h2>
47     <table class="table table-bordered table-condensed">
48       <thead>
49         <tr>
50           <th>Score</th>
51           <th>Carrier Kills</th>
52           <th>Kills</th>
53           <th>Collects</th>
54           <th>Deaths</th>
55           <th>Destroys</th>
56           <th>Suicides</th>
57           <th>Destroys (with key)</th>
58           <th>Captures</th>
59           <th>Pushes</th>
60           <th>Pickups</th>
61           <th>Pushed</th>
62           <th>Drops</th>
63           <th>Returns</th>
64         </tr>
65       </thead>
66       <tbody>
67         <tr>
68           <td>${game_stats['total_score']}</td>
69           <td>${game_stats['total_carrier_frags']}</td>
70           <td>${game_stats['total_kills']}</td>
71           <td>${game_stats['total_collects']}</td>
72           <td>${game_stats['total_deaths']}</td>
73           <td>${game_stats['total_destroys']}</td>
74           <td>${game_stats['total_suicides']}</td>
75           <td>${game_stats['total_destroys']}</td>
76           <td>${game_stats['total_captures']}</td>
77           <td>${game_stats['total_pushes']}</td>
78           <td>${game_stats['total_pickups']}</td>
79           <td>${game_stats['total_pushed']}</td>
80           <td>${game_stats['total_drops']}</td>
81           <td>${game_stats['total_returns']}</td>
82         </tr>
83       </tbody>
84     </table>
85     % endif
86   </div>
87 </div>
88
89
90 % if weapon_stats:
91 <div class="row">
92   <div class="span12">
93     <h3>Overall Accuracy</h3>
94     ${accuracy(weapon_stats)}
95   </div>
96 </div>
97 % endif
98
99
100 ##### RECENT GAMES (v2) ####
101 % if recent_games:
102 <div class="row">
103   <div class="span6">
104     <h3>Recent Games</h3>
105     <table class="table table-bordered table-condensed">
106       <thead>
107         <tr>
108            <th>Game Type</th>
109            <th>Map</th>
110            <th>Result</th>
111            <th>Played</th>
112            <th>Permalink</th>
113         </tr>
114       </thead>
115       <tbody>
116       % for (gamestat, game, server, map) in recent_games:
117         <tr>
118            <td><img title="${game.game_type_cd}" src="/static/images/icons/24x24/${game.game_type_cd}.png" alt="${game.game_type_cd}" /></td>
119            <td>${map.name}</td>
120            <td>
121            % if gamestat.team != None and gamestat.team == game.winner:
122            Won (#${gamestat.rank})
123            % elif gamestat.team != None and gamestat.team != game.winner:
124            Lost (#${gamestat.rank})
125                % else:
126                #${gamestat.rank}
127            % endif
128            </td>
129            <td>${game.fuzzy_date()}</td>
130            <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>
131         </tr>
132       % endfor
133       </tbody>
134     </table>
135     % if game_stats['total_games_played'] > 10:
136     <a href="${request.route_url("player_game_index", player_id=player.player_id, page=1)}" title="Game index for ${player.nick}">More games played by ${player.nick_html_colors()|n}...</a>
137     % endif
138   </div>
139 </div>
140 % endif