]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/map_info.mako
Add overall best flag capture times to the map info page.
[xonotic/xonstat.git] / xonstat / templates / map_info.mako
1 <%inherit file="base.mako"/>
2 <%namespace name="nav" file="nav.mako" />
3 <%namespace file="navlinks.mako" import="navlinks" />
4
5 <%block name="navigation">
6 ${nav.nav('maps')}
7 </%block>
8
9 <%block name="title">
10 % if gmap:
11 Map Information
12 % endif
13
14 ${parent.title()}
15 </%block>
16
17
18 % if gmap is None:
19 <h2>Sorry, that map wasn't found!</h2>
20
21 % else:
22 <h2>${gmap.name}</h2>
23 <p>
24   Added <span class="abstime" data-epoch="${gmap.epoch()}" title="${gmap.create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${gmap.fuzzy_date()}</span>
25 </p>
26 <div class="row">
27   <div class="span4">
28     <h3>Top Scoring Players</h3>
29     <table class="table table-bordered table-condensed">
30       <thead>
31         <tr>
32           <th>#</th>
33           <th>Nick</th>
34           <th>Score</th>
35         </tr>
36       </thead>
37       <tbody>
38         <% i = 1 %>
39         % for (score_player_id, score_nick, score_value) in top_scorers:
40         <tr>
41           <td>${i}</td>
42           % if score_player_id != '-':
43           <td><a href="${request.route_url('player_info', id=score_player_id)}" title="Go to the player info page for this player">${score_nick|n}</a></td>
44           % else:
45           <td>${score_nick}</td>
46           % endif
47           <td>${score_value}</td>
48         </tr>
49         <% i = i+1 %>
50         % endfor
51         </tbody>
52     </table>
53   </div>
54
55
56 <div class="span4">
57   <h3>Most Active Players</h3>
58   <table class="table table-bordered table-condensed">
59     <thead>
60       <tr>
61         <th>#</th>
62         <th>Nick</th>
63         <th>Playing Time</th>
64       </tr>
65     </thead>
66     <tbody>
67     <% i = 1 %>
68     % for (player_id, nick, alivetime) in top_players:
69       <tr>
70         <td>${i}</td>
71         % if player_id != '-':
72         <td><a href="${request.route_url('player_info', id=player_id)}" title="Go to the player info page for this player">${nick|n}</a></td>
73         % else:
74         <td>${nick}</td>
75         % endif
76         <td>${alivetime}</td>
77       </tr>
78       <% i = i+1 %>
79     % endfor
80     </tbody>
81   </table>
82 </div>
83
84
85 <div class="span4">
86   <h3>Most Active Servers</h3>
87   <table class="table table-bordered table-condensed">
88     <thead>
89       <tr>
90         <th>#</th>
91         <th>Name</th>
92         <th>Times Played</th>
93       </tr>
94     </thead>
95     <tbody>
96     <% i = 1 %>
97     % for (server_id, name, times_played) in top_servers:
98       <tr>
99         <td>${i}</td>
100         <td><a href="${request.route_url('server_info', id=server_id)}" title="Go to the server info page for this server">${name}</a></td>
101         <td>${times_played}</td>
102       </tr>
103       <% i = i+1 %>
104     % endfor
105     </tbody>
106 </table>
107 </div>
108 </div> <!-- /row -->
109
110 % if len(captimes) > 0:
111 <div class="row">
112   <div class="span6">
113     <h3>Best Flag Capture Times</h3>
114     <table class="table table-bordered table-condensed">
115       <thead>
116         <tr>
117            <th>Nick</th>
118            <th>Captime</th>
119         </tr>
120       </thead>
121       <tbody>
122       % for c in captimes:
123         <tr>
124           <td>
125           % if c.player_id > 2:
126             <a href="${request.route_url("player_info", id=c.player_id)}"
127              title="Go to the info page for this player">
128             <span class="nick">${c.nick_html_colors|n}</span>
129             </a>
130           % else:
131             <span class="nick">${c.nick_html_colors|n}</span>
132           % endif
133           </td>
134           <td>${round(float(c.fastest_cap.seconds) + (c.fastest_cap.microseconds/1000000.0), 2)}</td>
135         </tr>
136       % endfor
137       </tbody>
138     </table>
139   </div>
140 </div>
141 % endif
142
143
144 <div class="row">
145   <div class="span12">
146     <h3>Recent Games</h3>
147     <table class="table table-bordered table-condensed">
148       <thead>
149         <tr>
150           <th></th>
151           <th>Type</th>
152           <th>Time</th>
153           <th>Winner</th>
154         </tr>
155       </thead>
156       <tbody>
157         % for (game, srv, map, pgstat) in recent_games:
158         % if game != '-':
159         <tr>
160           <td><a class="btn btn-primary btn-small" href="${request.route_url('game_info', id=game.game_id)}" title="View detailed information about this game">View</a></td>
161           <td class="gt_icon"><img title="${game.game_type_cd}" src="/static/images/icons/24x24/${game.game_type_cd}.png" alt="${game.game_type_cd}" /></td>
162           <td><span class="abstime" data-epoch="${game.epoch()}" title="${game.start_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${game.fuzzy_date()}</span></td>
163           <td>
164             % if pgstat.player_id > 2:
165             <a href="${request.route_url('player_info', id=pgstat.player_id)}" title="Go to the player info page for this player">${pgstat.nick_html_colors()|n}</a>
166           </td>
167             % else:
168             ${pgstat.nick_html_colors()|n}
169           </td>
170             % endif
171         </tr>
172         % else:
173         <tr>
174           <td>-</td>
175           <td>-</td>
176           <td>-</td>
177           <td>-</td>
178         </tr>
179         % endif
180     % endfor
181         </tbody>
182     </table>
183   </div>
184 </div>
185
186
187 % endif