]> git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/main_index.mako
Use Luma throughout the site. Thank you, sev!
[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/luma.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="small-12 large-12 columns">
31       <p class="text-center"><i class="icon-white icon-info-sign"> </i> You don't seem to have any ranks yet.</p>
32     </div>
33   </div>
34
35 % else:
36   <div class="row">
37     % for rs in ranks[:4]:
38       % if len(rs) > 0:
39         <div class="small-12 large-3 columns">
40           % if rs[0].game_type_cd == 'duel':
41             <h5>Duel Ranks <a href="${request.route_url('rank_index', game_type_cd=rs[0].game_type_cd)}" title="See more ${rs[0].game_type_cd} rankings"><i class="fa fa-plus-circle"></i></a></h5>
42           % elif rs[0].game_type_cd == 'ctf':
43             <h5>CTF Ranks <a href="${request.route_url('rank_index', game_type_cd=rs[0].game_type_cd)}" title="See more ${rs[0].game_type_cd} rankings"><i class="fa fa-plus-circle"></i></a></h5>
44           % elif rs[0].game_type_cd == 'dm':
45             <h5>DM Ranks <a href="${request.route_url('rank_index', game_type_cd=rs[0].game_type_cd)}" title="See more ${rs[0].game_type_cd} rankings"><i class="fa fa-plus-circle"></i></a></h5>
46           % elif rs[0].game_type_cd == 'tdm':
47             <h5>TDM Ranks <a href="${request.route_url('rank_index', game_type_cd=rs[0].game_type_cd)}" title="See more ${rs[0].game_type_cd} rankings"><i class="fa fa-plus-circle"></i></a></h5>
48           % endif
49
50           <table class="table-hover table-condensed">
51             <thead>
52               <tr>
53                 <th class="small-2">#</th>
54                 <th class="small-7">Nick</th>
55                 <th class="small-3">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="no-stretch"><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     </div>
71   % endif
72
73   % endfor
74 </div>
75 % endif
76
77
78 ##### ACTIVE PLAYERS #####
79 <div class="row">
80   <div class="small-12 large-4 columns">
81     <h5>Most Active Players <a href="${request.route_url('top_players_by_time', page=1)}" title="See more player activity"><i class="fa fa-plus-circle"></i></a></h5>
82       <table class="table table-hover table-condensed">
83         <thead>
84           <tr>
85             <th class="small-2">#</th>
86             <th class="small-7">Nick</th>
87             <th class="small-3">Time</th>
88           </tr>
89         </thead>
90         <tbody>
91         <% i = 1 %>
92         % for (player_id, nick, alivetime) in top_players:
93           <tr>
94             <td>${i}</td>
95             % if player_id != '-':
96             <td class="no-stretch"><a href="${request.route_url('player_info', id=player_id)}" title="Go to the player info page for this player">${nick|n}</a></td>
97             % else:
98             <td class="no-stretch" style="max-width:150px;">${nick|n}</td>
99             % endif
100             <td>${alivetime}</td>
101           </tr>
102           <% i = i+1 %>
103         % endfor
104         </tbody>
105       </table>
106   </div>
107
108
109 ##### ACTIVE SERVERS #####
110   <div class="small-12 large-4 columns">
111     <h5>Most Active Servers <a href="${request.route_url('top_servers_by_players', page=1)}" title="See more server activity"><i class="fa fa-plus-circle"></i></a></h5>
112     <table class="table table-hover table-condensed">
113       <thead>
114         <tr>
115           <th class="small-2">#</th>
116           <th class="small-7">Server</th>
117           <th class="small-3">Games</th>
118         </tr>
119       </thead>
120       <tbody>
121       <% i = 1 %>
122       % for (server_id, name, count) in top_servers:
123         <tr>
124           <td>${i}</td>
125           % if server_id != '-':
126           <td class="no-stretch"><a href="${request.route_url('server_info', id=server_id)}" title="Go to the server info page for ${name}">${name}</a></td>
127           % else:
128           <td>${name}</td>
129           % endif
130           <td>${count}</td>
131         </tr>
132         <% i = i+1 %>
133       % endfor
134       </tbody>
135     </table>
136   </div>
137
138
139 ##### ACTIVE MAPS #####
140   <div class="small-12 large-4 columns">
141     <h5>Most Active Maps <a href="${request.route_url('top_maps_by_times_played', page=1)}" title="See more map activity"><i class="fa fa-plus-circle"></i></a></h5>
142     <table class="table table-hover table-condensed">
143       <thead>
144         <tr>
145           <th class="small-2">#</th>
146           <th class="small-7">Map</th>
147           <th class="small-3">Games</th>
148         </tr>
149       </thead>
150       <tbody>
151       <% i = 1 %>
152       % for (map_id, name, count) in top_maps:
153         <tr>
154           <td>${i}</td>
155           % if map_id != '-':
156           <td class="no-stretch"><a href="${request.route_url('map_info', id=map_id)}" title="Go to the map info page for ${name}">${name}</a></td>
157           % else:
158           <td>${name}</td>
159           % endif
160           <td>${count}</td>
161         </tr>
162         <% i = i+1 %>
163       % endfor
164       </tbody>
165     </table>
166   </div>
167 </div>
168 <div class="row">
169   <div class="small-12 columns">
170     <small>*Most active stats are from the past 7 days</small>
171   </div>
172 </div>
173
174
175 ##### RECENT GAMES #####
176 % if len(recent_games) > 0:
177 <div class="row">
178   <div class="small-12 columns">
179     <h5>Recent Games <a href="${request.route_url('game_index')}"><i class="fa fa-plus-circle"></i></a></h5>
180     <table class="table table-hover table-condensed">
181       <thead>
182         <tr>
183           <th class="small-1 text-center"></th>
184           <th class="small-1">Type</th>
185           <th class="show-for-medium-up small-3">Server</th>
186           <th class="show-for-medium-up small-2">Map</th>
187           <th class="show-for-large-up small-2">Time</th>
188           <th class="small-3">Winner</th>
189         </tr>
190       </thead>
191       <tbody>
192       % for rg in recent_games:
193         <tr>
194           <td class="text-center"><a class="button tiny" href="${request.route_url('game_info', id=rg.game_id)}" title="View detailed information about this game">view</a></td>
195           <td class="text-center"><span class="sprite sprite-${rg.game_type_cd}" alt="${rg.game_type_cd}" title="${rg.game_type_descr}"></span></td>
196           <td class="show-for-medium-up no-stretch"><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>
197           <td class="show-for-medium-up"><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>
198           <td class="show-for-large-up"><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>
199           <td class="no-stretch">
200             % if rg.player_id > 2:
201             <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>
202             % else:
203             ${rg.nick_html_colors|n}</td>
204             % endif
205         </tr>
206         % endfor
207         </tbody>
208     </table>
209   </div>
210 </div>
211 % endif