]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/game_info.mako
e4981426faf492624f7722590840da45b666c65e
[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   <h2>Game Detail</h2>
36   <div class="span6 game-detail">
37     <img width="64" height="64" 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   % if teamscores:
50   <div class="span3 teamscores">
51     <table class="table table-condensed">
52     <thead>
53       <th>Team</th>
54       <th>Score</th>
55     </thead>
56     <tbody>
57     % for ts in teamscores:
58       <tr class="${ts.team}"><td>${ts.team.capitalize()}</td><td>${ts.score}</td></tr>
59     % endfor
60     </tbody>
61     </table>
62   </div>
63   % endif
64 </div>
65
66 % for team in stats_by_team.keys():
67 <div class="row">
68   <div class="span12 game">
69   ${scoreboard(game.game_type_cd, stats_by_team[team], show_elo, show_latency)}
70   </div>
71 </div>
72 % endfor
73
74 % if len(captimes) > 0:
75 <div class="row">
76   <div class="span6">
77     <h3>Best Flag Capture Times</h3>
78     <table class="table table-hover table-condensed">
79       <thead>
80         <tr>
81           <th>Nick</th>
82           <th>Captime</th>
83         </tr>
84       </thead>
85       <tbody>
86       % for pgs in captimes:
87       <tr>
88         <td>
89           % if pgs.player_id > 2:
90           <a href="${request.route_url("player_info", id=pgs.player_id)}"
91             title="Go to the info page for this player">
92             <span class="nick">${pgs.nick_html_colors()|n}</span>
93           </a>
94           % else:
95           <span class="nick">${pgs.nick_html_colors()|n}</span>
96           % endif
97         </td>
98         <td>${round(float(pgs.fastest.seconds) + (pgs.fastest.microseconds/1000000.0), 2)}</td>
99       </tr>
100       % endfor
101       </tbody>
102     </table>
103   </div>
104 </div>
105 % endif
106
107
108 % if len(pgstats) > 0 and len(pwstats) > 0:
109 <div class="row">
110   <div class="span12">
111     <h3>Accuracy Information</h3>
112     <div class="accordion" id="acc-accordion" style="display:none;">
113       % for pgstat in pgstats:
114       % if pgstat.player_game_stat_id in pwstats:
115       <div class="accordion-group">
116         <div class="accordion-heading">
117           <a class="accordion-toggle" data-toggle="collapse" data-parent="#acc-accordion" href="#accuracy-${pgstat.player_game_stat_id}">
118             Accuracy for ${pgstat.nick_html_colors()|n}
119           </a>
120         </div>
121         <div id="accuracy-${pgstat.player_game_stat_id}" class="accordion-body collapse in">
122           <div class="accordion-inner">
123             ${accuracy(pwstats[pgstat.player_game_stat_id])}
124           </div>
125         </div>
126       </div>
127       % endif
128       % endfor
129     </div>
130   </div>
131   % endif
132
133 </div>
134 % endif