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