]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/main_index.mako
The statline is a class, not an ID.
[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="text-center">
14     <img src="/static/css/img/xonotic-logo.png" />
15     % if stat_line is None:
16     <p class="statline">Tracking Xonotic statistics since October 2011.</p>
17     % else:
18     <p class="statline">Tracking ${stat_line|n} since October 2011.</p>
19     % endif
20
21     % if day_stat_line is not None:
22     <p class="statline">${day_stat_line|n} in the past 24 hours.</p>
23     % endif
24   </div>
25 </%block>
26
27 ##### RANKS #####
28 % if len(ranks) < 4:
29   <div class="row">
30     <div class="span12">
31       <p style="text-align: center;"><i class="icon-white icon-info-sign"> </i> You don't seem to have any ranks yet.</p>
32     </div> <!-- span12 -->
33   </div> <!-- row -->
34
35 % else:
36   <div class="row">
37     % for rs in ranks[:4]:
38     % if len(rs) > 0:
39     <div class="span3">
40       % if rs[0].game_type_cd == 'duel':
41       <h3>Duel Ranks</h3>
42       % elif rs[0].game_type_cd == 'ctf':
43       <h3>CTF Ranks</h3>
44       % elif rs[0].game_type_cd == 'dm':
45       <h3>DM Ranks</h3>
46       % elif rs[0].game_type_cd == 'tdm':
47       <h3>TDM Ranks</h3>
48       % endif
49
50       <table class="table table-hover table-condensed">
51         <thead>
52           <tr>
53             <th style="width:40px;">#</th>
54             <th style="width:150px;">Nick</th>
55             <th style="width:60px;">Elo</th>
56           </tr>
57         </thead>
58         <tbody>
59         <% i = 1 %>
60         % for r in rs:
61         <tr>
62           <td>${i}</td>
63           <td class="nostretch" style="max-width:150px;"><a href="${request.route_url('player_info', id=r.player_id)}" title="Go to the player info page for this player">${r.nick_html_colors()|n}</a></td>
64           <td>${int(round(r.elo))}</td>
65         </tr>
66         <% i = i+1 %>
67         % endfor
68         </tbody>
69       </table>
70       <p class="note"><a href="${request.route_url('rank_index', page=1, game_type_cd=rs[0].game_type_cd)}" title="See more ${rs[0].game_type_cd} rankings">More...</a></p>
71     </div> <!-- /span4 -->
72   % endif
73
74   % endfor
75 </div> <!-- row -->
76 % endif
77
78
79 ##### ACTIVE PLAYERS #####
80 <div class="row">
81   <div class="span4">
82     <h3>Most Active Players</h3>
83     <table class="table table-hover table-condensed">
84       <thead>
85         <tr>
86           <th style="width:40px;">#</th>
87           <th style="width:150px;">Nick</th>
88           <th class="play-time" style="width:90px;">Play Time</th>
89         </tr>
90       </thead>
91       <tbody>
92       <% i = 1 %>
93       % for (player_id, nick, alivetime) in top_players:
94         <tr>
95           <td>${i}</td>
96           % if player_id != '-':
97           <td class="nostretch" style="max-width:150px;"><a href="${request.route_url('player_info', id=player_id)}" title="Go to the player info page for this player">${nick|n}</a></td>
98           % else:
99           <td class="nostretch" style="max-width:150px;">${nick|n}</td>
100           % endif
101           <td class="play-time">${alivetime}</td>
102         </tr>
103         <% i = i+1 %>
104       % endfor
105       </tbody>
106     </table>
107     <p class="note"><a href="${request.route_url('top_players_by_time', page=1)}" title="See more player activity">More...</a></p>
108   </div> <!-- /span4 -->
109
110
111 ##### ACTIVE SERVERS #####
112   <div class="span4">
113     <h3>Most Active Servers</h3>
114     <table class="table table-hover table-condensed">
115       <thead>
116         <tr>
117           <th style="width:40px;">#</th>
118           <th style="width:180px;">Server</th>
119           <th style="width:60px;">Games</th>
120         </tr>
121       </thead>
122       <tbody>
123       <% i = 1 %>
124       % for (server_id, name, count) in top_servers:
125         <tr>
126           <td>${i}</td>
127           % if server_id != '-':
128           <td class="nostretch" style="max-width:180px;"><a href="${request.route_url('server_info', id=server_id)}" title="Go to the server info page for ${name}">${name}</a></td>
129           % else:
130           <td class="nostretch" style="max-width:180px;">${name}</td>
131           % endif
132           <td>${count}</td>
133         </tr>
134         <% i = i+1 %>
135       % endfor
136       </tbody>
137     </table>
138     <p class="note"><a href="${request.route_url('top_servers_by_players', page=1)}" title="See more server activity">More...</a></p>
139   </div> <!-- /span4 -->
140
141
142 ##### ACTIVE MAPS #####
143   <div class="span4">
144     <h3>Most Active Maps</h3>
145     <table class="table table-hover table-condensed">
146       <thead>
147         <tr>
148           <th style="width:40px;">#</th>
149           <th style="width:180px;">Map</th>
150           <th style="width:60px;">Games</th>
151         </tr>
152       </thead>
153       <tbody>
154       <% i = 1 %>
155       % for (map_id, name, count) in top_maps:
156         <tr>
157           <td>${i}</td>
158           % if map_id != '-':
159           <td class="nostretch" style="max-width:180px;"><a href="${request.route_url('map_info', id=map_id)}" title="Go to the map info page for ${name}">${name}</a></td>
160           % else:
161           <td class="nostretch" style="max-width:180px;">${name}</td>
162           % endif
163           <td>${count}</td>
164         </tr>
165         <% i = i+1 %>
166       % endfor
167       </tbody>
168     </table>
169     <p class="note"><a href="${request.route_url('top_maps_by_times_played', page=1)}" title="See more map activity">More...</a></p>
170   </div> <!-- /span4 -->
171 </div> <!-- /row -->
172 <row class="span12">
173     <p class="note">*Most active stats are from the past 7 days</p>
174 </div>
175
176
177 ##### RECENT GAMES #####
178 % if len(recent_games) > 0:
179 <div class="row">
180   <div class="span12">
181     <h3>Recent Games</h3>
182     <table class="table table-hover table-condensed">
183       <thead>
184         <tr>
185           <th></th>
186           <th>Type</th>
187           <th>Server</th>
188           <th>Map</th>
189           <th>Time</th>
190           <th>Winner</th>
191         </tr>
192       </thead>
193       <tbody>
194       % for rg in recent_games:
195         <tr>
196           <td class="tdcenter"><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>
197           <td class="tdcenter"><span class="sprite sprite-${rg.game_type_cd}" alt="${rg.game_type_cd}" title="${rg.game_type_descr}"></span></td>
198           <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>
199           <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>
200           <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>
201           <td class="nostretch">
202             % if rg.player_id > 2:
203             <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>
204             % else:
205             ${rg.nick_html_colors|n}</td>
206             % endif
207         </tr>
208         % endfor
209         </tbody>
210     </table>
211     <p><a href="${request.route_url('game_index')}">More...</a></p>
212   </div> <!-- /span12 -->
213 </div> <!-- /row -->
214 % endif