]> git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/main_index.mako
Integrate the new helpers everywhere.
[xonotic/xonstat.git] / xonstat / templates / main_index.mako
1 <%inherit file="base.mako"/>
2
3 <%block name="title">
4 Leaderboard
5 </%block>
6
7 <%block name="css">
8     ${parent.css()}
9     <link href="/static/css/sprites.css" rel="stylesheet">
10 </%block>
11
12 <%block name="hero_unit">
13       <div class="hero-unit">
14         <img src="/static/css/img/web_background_l2.png" />
15         #####<p id="statline">Tracking <a href="#">12345</a> players, <a href="#">12345</a> games (<a href="#">123</a> duels, <a href="#">123</a> ctfs, <a href="#">123</a> dms), <a href="#">12345</a> servers, and <a href="#">12345</a> maps since November 2011.</p>
16         <p id="statline">Tracking Xonotic statistics since October 2011.</p>
17       </div>
18 </%block>
19
20 <div class="row">
21   <div class="span4">
22     ##### DUEL RANKS #####
23     <h3>Duel Ranks</h3>
24     <table class="table table-bordered table-condensed">
25       <thead>
26         <tr>
27           <th>#</th>
28           <th>Nick</th>
29           <th>Elo</th>
30         </tr>
31       </thead>
32       <tbody>
33       <% i = 1 %>
34       % for (player_id, nick, elo) in duel_ranks:
35         <tr>
36           <td>${i}</td>
37           % if player_id != '-':
38           <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>
39           % else:
40           <td>${nick|n}</td>
41           % endif
42           % if elo != '-':
43           <td>${round(elo, 3)}</td>
44           % else:
45           <td>${elo}</td>
46           % endif
47         </tr>
48         <% i = i+1 %>
49       % endfor
50       </tbody>
51     </table>
52     <p class="note"><a href="${request.route_url('rank_index', page=1, game_type_cd='duel')}" title="See more duel rankings">More...</a></p>
53   </div> <!-- /span4 -->
54
55   <div class="span4">
56     ##### CTF RANKS #####
57     <h3>CTF Ranks</h3>
58     <table class="table table-bordered table-condensed">
59       <thead>
60         <tr>
61           <th>#</th>
62           <th>Nick</th>
63           <th>Elo</th>
64         </tr>
65       </thead>
66       <tbody>
67       <% i = 1 %>
68       % for (player_id, nick, elo) in ctf_ranks:
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|n}</td>
75           % endif
76           % if elo != '-':
77           <td>${round(elo, 3)}</td>
78           % else:
79           <td>${elo}</td>
80           % endif
81         </tr>
82         <% i = i+1 %>
83       % endfor
84       </tbody>
85     </table>
86     <p class="note"><a href="${request.route_url('rank_index', page=1, game_type_cd='ctf')}" title="See more CTF rankings">More...</a></p>
87   </div> <!-- /span4 -->
88
89   <div class="span4">
90     ##### DM RANKS #####
91     <h3>DM Ranks</h3>
92     <table class="table table-bordered table-condensed">
93       <thead>
94         <tr>
95           <th>#</th>
96           <th>Nick</th>
97           <th>Elo</th>
98         </tr>
99       </thead>
100       <tbody>
101       <% i = 1 %>
102       % for (player_id, nick, elo) in dm_ranks:
103         <tr>
104           <td>${i}</td>
105           % if player_id != '-':
106           <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>
107           % else:
108           <td>${nick|n}</td>
109           % endif
110           % if elo != '-':
111           <td>${round(elo, 3)}</td>
112           % else:
113           <td>${elo}</td>
114           % endif
115         </tr>
116         <% i = i+1 %>
117       % endfor
118     </tbody>
119   </table>
120   <p class="note"><a href="${request.route_url('rank_index', page=1, game_type_cd='dm')}" title="See more deathmatch rankings">More...</a></p>
121   </div> <!-- /span4 -->
122 </div> <!-- /row -->
123
124 <div class="row">
125   <div class="span4">
126     <h3>Most Active Players</h3>
127     <table class="table table-bordered table-condensed">
128       <thead>
129         <tr>
130           <th>#</th>
131           <th>Nick</th>
132           <th class="play-time">Play Time</th>
133         </tr>
134       </thead>
135       <tbody>
136       <% i = 1 %>
137       % for (player_id, nick, alivetime) in top_players:
138         <tr>
139           <td>${i}</td>
140           % if player_id != '-':
141           <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>
142           % else:
143           <td>${nick|n}</td>
144           % endif
145           <td class="play-time">${alivetime}</td>
146         </tr>
147         <% i = i+1 %>
148       % endfor
149       </tbody>
150     </table>
151     <p class="note">*Most active stats are from the past 7 days</p>
152   </div> <!-- /span4 -->
153
154   <div class="span4">
155     <h3>Most Active Servers</h3>
156     <table class="table table-bordered table-condensed">
157       <thead>
158         <tr>
159           <th>#</th>
160           <th>Server</th>
161           <th>Games</th>
162         </tr>
163       </thead>
164       <tbody>
165       <% i = 1 %>
166       % for (server_id, name, count) in top_servers:
167         <tr>
168           <td>${i}</td>
169           % if server_id != '-':
170           <td><a href="${request.route_url('server_info', id=server_id)}" title="Go to the server info page for ${name}">${name}</a></td>
171           % else:
172           <td>${name}</td>
173           % endif
174           <td>${count}</td>
175         </tr>
176         <% i = i+1 %>
177       % endfor
178       </tbody>
179     </table>
180   </div> <!-- /span4 -->
181
182   <div class="span4">
183     <h3>Most Active Maps</h3>
184     <table class="table table-bordered table-condensed">
185       <thead>
186         <tr>
187           <th>#</th>
188           <th>Map</th>
189           <th>Games</th>
190         </tr>
191       </thead>
192       <tbody>
193       <% i = 1 %>
194       % for (map_id, name, count) in top_maps:
195         <tr>
196           <td>${i}</td>
197           % if map_id != '-':
198           <td><a href="${request.route_url('map_info', id=map_id)}" title="Go to the map info page for ${name}">${name}</a></td>
199           % else:
200           <td>${name}</td>
201           % endif
202           <td>${count}</td>
203         </tr>
204         <% i = i+1 %>
205       % endfor
206       </tbody>
207     </table>
208   </div> <!-- /span4 -->
209 </div> <!-- /row -->
210
211 % if len(recent_games) > 0:
212 <div class="row">
213   <div class="span12">
214     <h3>Recent Games</h3>
215     <table class="table table-bordered table-condensed">
216       <thead>
217         <tr>
218           <th></th>
219           <th>Type</th>
220           <th>Server</th>
221           <th>Map</th>
222           <th>Time</th>
223           <th>Winner</th>
224         </tr>
225       </thead>
226       <tbody>
227       % for rg in recent_games:
228         <tr>
229           <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>
230           <!-- <td class="gt_icon"><img title="${rg.game_type_cd}" src="/static/images/icons/24x24/${rg.game_type_cd}.png" alt="${rg.game_type_cd}" /></td> -->
231           <td><span class="sprite sprite-${rg.game_type_cd}" title="${rg.game_type_cd}"></span></td>
232           <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>
233           <td><a href="${request.route_url('map_info', id=rg.map_id)}" title="Go to the map detail page for this map">${rg.map_name}</a></td>
234           <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>
235           <td>
236             % if rg.player_id > 2:
237             <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></td>
238             % else:
239             ${rg.nick_html_colors|n}</td>
240             % endif
241         </tr>
242         % endfor
243         </tbody>
244     </table>
245   </div> <!-- /span12 -->
246 </div> <!-- /row -->
247 % endif