]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/game_info.mako
Add the game's duration to the game info page, if it exists.
[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="js">
11       <script src="/static/js/jquery-1.7.1.min.js"></script>
12       <script src="/static/js/bootstrap-collapse.min.js"></script>
13       <script>
14         $(".collapse").collapse();
15
16         // show accordion only when loaded to prevent rollup from being seen
17         $("#acc-accordion").css('display', '');
18       </script>
19 </%block>
20
21 <%block name="title">
22 Game Information
23 </%block>
24
25
26 % if game is None:
27 <h2>Sorry, that game wasn't found!</h2>
28
29 % else:
30 <div class="row">
31   <div class="span6">
32     <h2>Game Detail</h2>
33     <p>
34       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 />
35       Game Type: ${game.game_type_cd}<br />
36       Server: <a href="${request.route_url("server_info", id=server.server_id)}" name="Server info page for ${server.name}">${server.name}</a><br />
37       Map: <a href="${request.route_url("map_info", id=map.map_id)}" name="Map info page for ${map.name}">${map.name}</a><br />
38       % if game.duration is not None:
39         Duration: ${"%s:%02d" % (game.duration.seconds/60, game.duration.seconds%60)}
40       % endif
41     </p>
42   </div>
43 </div>
44
45 <div class="row">
46   <div class="span12 game">
47     <h3>Scoreboard</h3>
48     ${scoreboard(game.game_type_cd, pgstats, show_elo)}
49   </div>
50 </div>
51
52 % if len(captimes) > 0:
53 <div class="row">
54   <div class="span6">
55     <h3>Best Flag Capture Times</h3>
56     <table class="table table-bordered table-condensed">
57       <thead>
58         <tr>
59            <th>Nick</th>
60            <th>Captime</th>
61         </tr>
62       </thead>
63       <tbody>
64       % for pgs in captimes:
65         <tr>
66           <td>
67           % if pgs.player_id > 2:
68             <a href="${request.route_url("player_info", id=pgs.player_id)}"
69              title="Go to the info page for this player">
70             <span class="nick">${pgs.nick_html_colors()|n}</span>
71             </a>
72           % else:
73             <span class="nick">${pgs.nick_html_colors()|n}</span>
74           % endif
75           </td>
76           <td>${round(float(pgs.fastest_cap.seconds) + (pgs.fastest_cap.microseconds/1000000.0), 2)}</td>
77         </tr>
78       % endfor
79       </tbody>
80     </table>
81   </div>
82 </div>
83 % endif
84
85
86 % if len(pgstats) > 0:
87 <div class="row">
88   <div class="span12">
89     <h3>Accuracy Information</h3>
90     <div class="accordion" id="acc-accordion" style="display:none;">
91     % for pgstat in pgstats:
92     % if pgstat.player_game_stat_id in pwstats:
93       <div class="accordion-group">
94         <div class="accordion-heading">
95           <a class="accordion-toggle" data-toggle="collapse" data-parent="#acc-accordion" href="#accuracy-${pgstat.player_game_stat_id}">
96           Accuracy for ${pgstat.nick_html_colors()|n}
97           </a>
98         </div>
99         <div id="accuracy-${pgstat.player_game_stat_id}" class="accordion-body collapse in">
100           <div class="accordion-inner">
101             ${accuracy(pwstats[pgstat.player_game_stat_id])}
102           </div>
103         </div>
104       </div>
105     % endif
106     % endfor
107   </div>
108 </div>
109 % endif
110
111 </div>
112 % endif