]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/player_info.mako
Integrate navigation mako file and titles.
[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="css">
10 ${parent.css()}
11 <link rel="stylesheet" href="/static/css/colorbox.css" type="text/css" media="screen" />
12 </%block>
13
14 <%block name="js">
15 ${parent.js()}
16 <script src="/static/js/jquery.colorbox-min.js"></script>
17 </%block>
18
19 <%block name="title">
20 % if player:
21 Player Information for ${player.nick_strip_colors()}
22 % endif
23
24 ${parent.title()}
25 </%block>
26
27
28 % if player is None:
29 <h2>This player is so good we couldn't find him!</h2>
30 <p>Seriously though, he probably doesn't exist...just a figment of your imagination. Carry on then!</p>
31
32 % else:
33 <h2>${player.nick_html_colors()|n}</h2>
34 <p>
35    Member Since: ${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')} <br />
36    Last Seen: ${recent_games[0][1].fuzzy_date()} <br />
37    Playing Time: ${game_stats['total_alivetime']} <br />
38    Games Played: ${game_stats['total_games_played']} <br />
39    Average Rank: ${game_stats['avg_rank']} <br />
40 </p>
41 % endif
42
43
44 ##### STATS #####
45 % if game_stats:
46 <h2>Overall Game Stats</h2>
47 <table id="player-game-stats">
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
87 ##### ACCURACY #####
88 % if weapon_stats:
89 <h2>Overall Accuracy</h2>
90 ${accuracy(weapon_stats)}
91 % endif
92
93
94 ##### RECENT GAMES (v2) ####
95 % if recent_games:
96 <h2>Recent Games</h2>
97 <table>
98         <thead>
99                 <tr>
100                    <th>Game Type</th>
101                    <th>Map</th>
102                    <th>Result</th>
103                    <th>Played</th>
104                    <th>Permalink</th>
105                 </tr>
106         </thead>
107         <tbody>
108         % for (gamestat, game, server, map) in recent_games:
109                 <tr>
110                    <td><img title="${game.game_type_cd}" src="/static/images/icons/24x24/${game.game_type_cd}.png" alt="${game.game_type_cd}" /></td>
111                    <td>${map.name}</td>
112                    <td>
113                    % if gamestat.team != None and gamestat.team == game.winner:
114                    Won (#${gamestat.rank})
115                    % elif gamestat.team != None and gamestat.team != game.winner:
116                    Lost (#${gamestat.rank})
117            % else:
118            #${gamestat.rank}
119                    % endif
120                    </td>
121                    <td>${game.fuzzy_date()}</td>
122                    <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>
123                 </tr>
124         % endfor
125         </tbody>
126 </table>
127 % if game_stats['total_games_played'] > 10:
128 <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}...
129 % endif
130 % endif