]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/main_index.mako
Use Luma game type icons on the player-recent-games view. Fixes #150.
[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="hero_unit">
8   <div class="text-center">
9     <img src="/static/css/img/xonotic-logo.png" />
10     % if stat_line is None:
11       <p class="statline">Tracking Xonotic statistics since October 2011.</p>
12     % else:
13       <p class="statline">Tracking ${stat_line|n} since October 2011.</p>
14     % endif
15
16     % if day_stat_line is not None:
17       <p class="statline">${day_stat_line|n} in the past 24 hours.</p>
18     % endif
19   </div>
20 </%block>
21
22 ##### RANKS #####
23 % if len(ranks) < 4:
24   <div class="row">
25     <div class="small-12 large-12 columns">
26       <p class="text-center"><i class="icon-white icon-info-sign"> </i> You don't seem to have any ranks yet.</p>
27     </div>
28   </div>
29
30 % else:
31   <div class="row">
32     % for rs in ranks[:4]:
33       % if len(rs) > 0:
34         <div class="small-12 large-3 columns">
35           % if rs[0].game_type_cd == 'duel':
36             <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>
37           % elif rs[0].game_type_cd == 'ctf':
38             <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>
39           % elif rs[0].game_type_cd == 'dm':
40             <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>
41           % elif rs[0].game_type_cd == 'tdm':
42             <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>
43           % endif
44
45           <table class="table-hover table-condensed">
46             <thead>
47               <tr>
48                 <th class="small-2">#</th>
49                 <th class="small-7">Nick</th>
50                 <th class="small-3">Elo</th>
51               </tr>
52             </thead>
53             <tbody>
54             <% i = 1 %>
55             % for r in rs:
56             <tr>
57               <td>${i}</td>
58               <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>
59               <td>${int(round(r.elo))}</td>
60             </tr>
61             <% i = i+1 %>
62             % endfor
63             </tbody>
64           </table>
65     </div>
66   % endif
67
68   % endfor
69 </div>
70 % endif
71
72
73 ##### ACTIVE PLAYERS #####
74 <div class="row">
75   <div class="small-12 large-4 columns">
76     <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>
77       <table class="table table-hover table-condensed">
78         <thead>
79           <tr>
80             <th class="small-2">#</th>
81             <th class="small-7">Nick</th>
82             <th class="small-3">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 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>
92             % else:
93             <td class="no-stretch" style="max-width:150px;">${nick|n}</td>
94             % endif
95             <td>${alivetime}</td>
96           </tr>
97           <% i = i+1 %>
98         % endfor
99         </tbody>
100       </table>
101   </div>
102
103
104 ##### ACTIVE SERVERS #####
105   <div class="small-12 large-4 columns">
106     <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>
107     <table class="table table-hover table-condensed">
108       <thead>
109         <tr>
110           <th class="small-2">#</th>
111           <th class="small-7">Server</th>
112           <th class="small-3">Games</th>
113         </tr>
114       </thead>
115       <tbody>
116       <% i = 1 %>
117       % for (server_id, name, count) in top_servers:
118         <tr>
119           <td>${i}</td>
120           % if server_id != '-':
121           <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>
122           % else:
123           <td>${name}</td>
124           % endif
125           <td>${count}</td>
126         </tr>
127         <% i = i+1 %>
128       % endfor
129       </tbody>
130     </table>
131   </div>
132
133
134 ##### ACTIVE MAPS #####
135   <div class="small-12 large-4 columns">
136     <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>
137     <table class="table table-hover table-condensed">
138       <thead>
139         <tr>
140           <th class="small-2">#</th>
141           <th class="small-7">Map</th>
142           <th class="small-3">Games</th>
143         </tr>
144       </thead>
145       <tbody>
146       <% i = 1 %>
147       % for (map_id, name, count) in top_maps:
148         <tr>
149           <td>${i}</td>
150           % if map_id != '-':
151           <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>
152           % else:
153           <td>${name}</td>
154           % endif
155           <td>${count}</td>
156         </tr>
157         <% i = i+1 %>
158       % endfor
159       </tbody>
160     </table>
161   </div>
162 </div>
163 <div class="row">
164   <div class="small-12 columns">
165     <small>*Most active stats are from the past 7 days</small>
166   </div>
167 </div>
168
169
170 ##### RECENT GAMES #####
171 % if len(recent_games) > 0:
172 <div class="row">
173   <div class="small-12 columns">
174     <h5>Recent Games <a href="${request.route_url('game_index')}"><i class="fa fa-plus-circle"></i></a></h5>
175     <table class="table table-hover table-condensed">
176       <thead>
177         <tr>
178           <th class="small-1 text-center"></th>
179           <th class="small-1">Type</th>
180           <th class="show-for-medium-up small-3">Server</th>
181           <th class="show-for-medium-up small-2">Map</th>
182           <th class="show-for-large-up small-2">Time</th>
183           <th class="small-3">Winner</th>
184         </tr>
185       </thead>
186       <tbody>
187       % for rg in recent_games:
188         <tr>
189           <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>
190           <td class="text-center"><span class="sprite sprite-${rg.game_type_cd}" alt="${rg.game_type_cd}" title="${rg.game_type_descr}"></span></td>
191           <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>
192           <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>
193           <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>
194           <td class="no-stretch">
195             % if rg.player_id > 2:
196             <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>
197             % else:
198             ${rg.nick_html_colors|n}</td>
199             % endif
200         </tr>
201         % endfor
202         </tbody>
203     </table>
204   </div>
205 </div>
206 % endif