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