]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/game_info.mako
Remove Persona since it was shut down. :(
[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="foundation">
11   <script>
12   $(document).foundation({
13       accordion: {
14         multi_expand: true,
15       }
16     });
17   </script>
18 </%block>
19
20 <%block name="title">
21   Game Information
22 </%block>
23
24
25 % if game is None:
26   <h2>Sorry, that game wasn't found!</h2>
27
28 % else:
29   <div class="row">
30
31     <div class="small-12 columns">
32       <h3>Game #${game.game_id}</h3>
33       <p>
34         <span class="sprite sprite-${game.game_type_cd}"></span> ${gametype.descr} <br />
35         Played ${game.fuzzy_date()} <span class="abstime" data-epoch="${game.epoch()}" title="${game.start_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}"> <i class="fa fa-info-circle"></i></span><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
44     % if teamscores:
45       <div class="small-3 columns">
46         <table class="table-condensed">
47           <thead>
48             <th>Team</th>
49             <th>Score</th>
50           </thead>
51           <tbody>
52             % for ts in teamscores:
53               <tr class="${ts.team}"><td>${ts.team.capitalize()}</td><td>${ts.score}</td></tr>
54             % endfor
55           </tbody>
56         </table>
57       </div>
58     % endif
59   </div>
60
61   ##### Games that have team scores push the scoreboard table to the right by
62   ##### one column. 
63   % if len(tgstats) == len(stats_by_team):
64     % for tgstat in tgstats:
65       <div class="row">
66
67         <div class="small-1 columns teamscore">
68           <div class="teamname ${tgstat.team_html_color()}">
69             ${tgstat.team_html_color().capitalize()}
70           </div>
71           <div class="${tgstat.team_html_color()}">
72             % if game.game_type_cd == 'ctf':
73               ${tgstat.caps}
74             % elif game.game_type_cd == 'ca':
75               ${tgstat.rounds}
76             % elif game.game_type_cd == 'nb':
77               ${tgstat.caps}
78             % else:
79               ${tgstat.score}
80             % endif
81           </div>
82         </div>
83
84         <div class="small-12 medium-11 columns game">
85           ${scoreboard(game.game_type_cd, stats_by_team[tgstat.team], show_elo, show_latency)}
86         </div>
87       </div>
88     % endfor
89
90   ##### Games that do not have team scores use the full width
91   % else:
92     % for team in stats_by_team.keys():
93       <div class="row">
94         <div class="small-12 columns game">
95           ${scoreboard(game.game_type_cd, stats_by_team[team], show_elo, show_latency)}
96         </div>
97       </div>
98     % endfor
99   % endif
100
101   % if len(captimes) > 0:
102     <div class="row">
103       <div class="small-6 columns">
104         <h3>Best Flag Capture Times</h3>
105         <table class="table-hover table-condensed">
106           <thead>
107             <tr>
108               <th>Nick</th>
109               <th>Captime</th>
110             </tr>
111           </thead>
112           <tbody>
113           % for pgs in captimes:
114           <tr>
115             <td>
116               % if pgs.player_id > 2:
117               <a href="${request.route_url("player_info", id=pgs.player_id)}"
118                 title="Go to the info page for this player">
119                 <span class="nick">${pgs.nick_html_colors()|n}</span>
120               </a>
121               % else:
122               <span class="nick">${pgs.nick_html_colors()|n}</span>
123               % endif
124             </td>
125             <td>${round(float(pgs.fastest.seconds) + (pgs.fastest.microseconds/1000000.0), 2)}</td>
126           </tr>
127           % endfor
128           </tbody>
129         </table>
130       </div>
131     </div>
132   % endif
133
134   % if len(pgstats) > 0 and len(pwstats) > 0:
135     <div class="row">
136       <div class="small-12 medium-9 columns">
137           <ul class="accordion" data-accordion>
138             % for pgstat in pgstats:
139               % if pgstat.player_game_stat_id in pwstats:
140                 <li class="accordion-navigation">
141                   <a href="#accuracy-${pgstat.player_game_stat_id}">Accuracy for ${pgstat.nick_html_colors()|n}</a>
142                   <div id="accuracy-${pgstat.player_game_stat_id}" class="content">
143                     ${accuracy(pwstats[pgstat.player_game_stat_id])}
144                   </div>
145                 </li>
146               % endif
147             % endfor
148           </ul>
149         </div>
150       </div>
151   % endif
152 % endif