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