615716cc067cc47310975b49aa7e6e89c268cde2
[xonotic/xonstat.git] / xonstat / templates / player_info.mako
1 <%inherit file="base.mako"/>
2 <%namespace file="accuracy.mako" import="accuracy" />
3
4 <%block name="css">
5 ${parent.css()}
6 <link rel="stylesheet" href="/static/css/colorbox.css" type="text/css" media="screen" />
7 </%block>
8
9 <%block name="js">
10 ${parent.js()}
11 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
12 <script src="/static/js/jquery.colorbox-min.js"></script>
13 <script>
14 $(document).ready(function(){
15     $(".recent_game_box").colorbox({width:"80%", height:"80%", iframe:true});
16 });
17 </script>
18 </%block>
19
20 <%block name="title">
21 % if player:
22 Player Information for ${player.nick_strip_colors()} - 
23 % endif
24
25 ${parent.title()}
26 </%block>
27
28
29 % if player is None:
30 <h2>This player is so good we couldn't find him!</h2>
31 <p>Seriously though, he probably doesn't exist...just a figment of your imagination. Carry on then!</p>
32
33 % else:
34 <h2>${player.nick_html_colors()|n}</h2>
35 <p>
36    Member Since: ${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')} <br />
37    Last Seen: ${recent_games[0][1].fuzzy_date()} <br />
38    Playing Time: ${game_stats['total_alivetime']} <br />
39    Games Played: ${game_stats['total_games_played']} <br />
40    Average Rank: ${game_stats['avg_rank']} <br />
41 </p>
42 % endif
43
44
45 ##### STATS #####
46 % if game_stats:
47 <h2>Overall Game Stats</h2>
48 <table border="1" cellpadding="3">
49   
50   <tr>
51     <th>Score</td><td>${game_stats['total_score']}</td>
52     <th>Carrier Kills</td><td>${game_stats['total_carrier_frags']}</td>
53   </tr>
54   <tr>
55     <th>Kills</td><td>${game_stats['total_kills']}</td>
56     <th>Collects</td><td>${game_stats['total_collects']}</td>
57   </tr>
58   <tr>
59     <th>Deaths</td><td>${game_stats['total_deaths']}</td>
60     <th>Destroys</td><td>${game_stats['total_destroys']}</td>
61   </tr>
62   <tr>
63     <th>Suicides</td><td>${game_stats['total_suicides']}</td>
64     <th>Destroys (with key)</td><td>${game_stats['total_destroys']}</td>
65   </tr>
66   <tr>
67     <th>Captures</td><td>${game_stats['total_captures']}</td>
68     <th>Pushes</td><td>${game_stats['total_pushes']}</td>
69   </tr>
70   <tr>
71     <th>Pickups</td><td>${game_stats['total_pickups']}</td>
72     <th>Pushed</td><td>${game_stats['total_pushed']}</td>
73   </tr>
74   <tr>
75     <th>Drops</td><td>${game_stats['total_drops']}</td>
76     <th>Returns</td><td>${game_stats['total_returns']}</td>
77   </tr>
78 </table>
79 % endif
80
81 ##### ACCURACY #####
82 % if weapon_stats:
83 <h2>Overall Accuracy</h2>
84 ${accuracy(weapon_stats)}
85 % endif
86
87
88 ##### RECENT GAMES (v2) ####
89 % if recent_games:
90 <h2>Recent Games</h2>
91 <table border="1" cellpadding="3">
92 <tr class='table-header'>
93    <td>Game Type</td>
94    <td>Map</td>
95    <td>Result</td>
96    <td>Played</td>
97    <td>Permalink</td>
98 </tr>
99 % for (gamestat, game, server, map) in recent_games:
100 <tr>
101    <td>${game.game_type_cd}</td>
102    <td>${map.name}</td>
103    <td>
104    % if gamestat.team != None and gamestat.team == game.winner:
105    Win
106    % else:
107    Loss
108    % endif
109    </td>
110    <td>${game.fuzzy_date()}</td>
111    <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>
112 </tr>
113 % endfor
114 </table>
115 <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}...
116 % endif