Fix another rank -> scoreboardpos bug.
[xonotic/xonstat.git] / xonstat / templates / game_info.mako
1 <%inherit file="base.mako"/>
2 <%namespace name="nav" file="nav.mako" />
3 <%namespace file="scoreboard.mako" import="scoreboard" />
4 <%namespace file="accuracy.mako" import="accuracy" />
5
6 <%block name="navigation">
7 ${nav.nav('games')}
8 </%block>
9
10 <%block name="css">
11 ${parent.css()}
12 <link href="/static/css/sprites.css" rel="stylesheet">
13 </%block>
14
15 <%block name="js">
16 ${parent.js()}
17 <script>
18 $(".collapse").collapse();
19
20 // show accordion only when loaded to prevent rollup from being seen
21 $("#acc-accordion").css('display', '');
22 </script>
23 </%block>
24
25 <%block name="title">
26 Game Information
27 </%block>
28
29
30 % if game is None:
31 <h2>Sorry, that game wasn't found!</h2>
32
33 % else:
34 <div class="row">
35   <div class="span10 game-detail">
36     <h2>Game Detail</h2>
37     <img width="48" height="48" src="/static/images/icons/48x48/${game.game_type_cd}.png" alt="${game.game_type_cd}"/>
38     <p>
39     Played: <span class="abstime" data-epoch="${game.epoch()}" title="${game.start_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${game.fuzzy_date()}</span><br />
40     Game Type: ${gametype.descr} (${game.game_type_cd})<br />
41     Server: <a href="${request.route_url("server_info", id=server.server_id)}" name="Server info page for ${server.name}">${server.name}</a><br />
42     Map: <a href="${request.route_url("map_info", id=map.map_id)}" name="Map info page for ${map.name}">${map.name}</a><br />
43     % if game.duration is not None:
44     Duration: ${"%s:%02d" % (game.duration.seconds/60, game.duration.seconds%60)}
45     % endif
46     </p>
47     <span class="clear"></span>
48   </div>
49 </div>
50
51 % for team in stats_by_team.keys():
52 <div class="row">
53   <div class="span12 game">
54   ${scoreboard(game.game_type_cd, stats_by_team[team], show_elo, show_latency)}
55   </div>
56 </div>
57 % endfor
58
59 % if len(captimes) > 0:
60 <div class="row">
61   <div class="span6">
62     <h3>Best Flag Capture Times</h3>
63     <table class="table table-hover table-condensed">
64       <thead>
65         <tr>
66           <th>Nick</th>
67           <th>Captime</th>
68         </tr>
69       </thead>
70       <tbody>
71       % for pgs in captimes:
72       <tr>
73         <td>
74           % if pgs.player_id > 2:
75           <a href="${request.route_url("player_info", id=pgs.player_id)}"
76             title="Go to the info page for this player">
77             <span class="nick">${pgs.nick_html_colors()|n}</span>
78           </a>
79           % else:
80           <span class="nick">${pgs.nick_html_colors()|n}</span>
81           % endif
82         </td>
83         <td>${round(float(pgs.fastest.seconds) + (pgs.fastest.microseconds/1000000.0), 2)}</td>
84       </tr>
85       % endfor
86       </tbody>
87     </table>
88   </div>
89 </div>
90 % endif
91
92
93 % if len(pgstats) > 0 and len(pwstats) > 0:
94 <div class="row">
95   <div class="span12">
96     <h3>Accuracy Information</h3>
97     <div class="accordion" id="acc-accordion" style="display:none;">
98       % for pgstat in pgstats:
99       % if pgstat.player_game_stat_id in pwstats:
100       <div class="accordion-group">
101         <div class="accordion-heading">
102           <a class="accordion-toggle" data-toggle="collapse" data-parent="#acc-accordion" href="#accuracy-${pgstat.player_game_stat_id}">
103             Accuracy for ${pgstat.nick_html_colors()|n}
104           </a>
105         </div>
106         <div id="accuracy-${pgstat.player_game_stat_id}" class="accordion-body collapse in">
107           <div class="accordion-inner">
108             ${accuracy(pwstats[pgstat.player_game_stat_id])}
109           </div>
110         </div>
111       </div>
112       % endif
113       % endfor
114     </div>
115   </div>
116   % endif
117
118 </div>
119 % endif