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