]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/main_index.mako
Add more links to the rankings.
[xonotic/xonstat.git] / xonstat / templates / main_index.mako
1 <%inherit file="base.mako"/>\r
2 \r
3 <%block name="title">\r
4 Main Page - ${parent.title()}\r
5 </%block>\r
6 \r
7 ##### DUEL RANKS #####\r
8 <div class="table_block">\r
9 <h2>Duel Ranks</h2>\r
10 <table class="rank-table">\r
11         <thead>\r
12                 <tr>\r
13                         <th>#</th>\r
14                         <th>Nick</th>\r
15                         <th>Elo</th>\r
16                 </tr>\r
17         </thead>\r
18         <tbody>\r
19         <% i = 1 %>\r
20         % for (player_id, nick, elo) in duel_ranks:\r
21                 <tr>\r
22                         <td>${i}</td>\r
23                         % if player_id != '-':\r
24                         <td><a href="${request.route_url('player_info', id=player_id)}" title="Go to the player info page for this player">${nick}</a></td>\r
25                         % else:\r
26                         <td>${nick}</td>\r
27                         % endif\r
28             % if elo != '-':\r
29                         <td>${round(elo, 3)}</td>\r
30             % else:\r
31                         <td>${elo}</td>\r
32             % endif\r
33                 </tr>\r
34                 <% i = i+1 %>\r
35         % endfor\r
36         </tbody>\r
37 </table>\r
38 <p class="note"><a href="${request.route_url('rank_index', page=1, game_type_cd='duel')}" title="See more duel rankings">More...</a></p>\r
39 </div>\r
40 \r
41 \r
42 \r
43 ##### CTF RANKS #####\r
44 <div class="table_block">\r
45 <h2>CTF Ranks</h2>\r
46 <table class="rank-table">\r
47         <thead>\r
48                 <tr>\r
49                         <th>#</th>\r
50                         <th>Nick</th>\r
51                         <th>Elo</th>\r
52                 </tr>\r
53         </thead>\r
54         <tbody>\r
55         <% i = 1 %>\r
56         % for (player_id, nick, elo) in ctf_ranks:\r
57                 <tr>\r
58                         <td>${i}</td>\r
59                         % if player_id != '-':\r
60                         <td><a href="${request.route_url('player_info', id=player_id)}" title="Go to the player info page for this player">${nick}</a></td>\r
61                         % else:\r
62                         <td>${nick}</td>\r
63                         % endif\r
64             % if elo != '-':\r
65                         <td>${round(elo, 3)}</td>\r
66             % else:\r
67                         <td>${elo}</td>\r
68             % endif\r
69                 </tr>\r
70                 <% i = i+1 %>\r
71         % endfor\r
72         </tbody>\r
73 </table>\r
74 <p class="note"><a href="${request.route_url('rank_index', page=1, game_type_cd='ctf')}" title="See more CTF rankings">More...</a></p>\r
75 </div>\r
76 \r
77 \r
78 \r
79 ##### DM RANKS #####\r
80 <div class="table_block">\r
81 <h2>DM Ranks</h2>\r
82 <table class="rank-table">\r
83         <thead>\r
84                 <tr>\r
85                         <th>#</th>\r
86                         <th>Nick</th>\r
87                         <th>Elo</th>\r
88                 </tr>\r
89         </thead>\r
90         <tbody>\r
91         <% i = 1 %>\r
92         % for (player_id, nick, elo) in dm_ranks:\r
93                 <tr>\r
94                         <td>${i}</td>\r
95                         % if player_id != '-':\r
96                         <td><a href="${request.route_url('player_info', id=player_id)}" title="Go to the player info page for this player">${nick}</a></td>\r
97                         % else:\r
98                         <td>${nick}</td>\r
99                         % endif\r
100             % if elo != '-':\r
101                         <td>${round(elo, 3)}</td>\r
102             % else:\r
103                         <td>${elo}</td>\r
104             % endif\r
105                 </tr>\r
106                 <% i = i+1 %>\r
107         % endfor\r
108         </tbody>\r
109 </table>\r
110 <p class="note"><a href="${request.route_url('rank_index', page=1, game_type_cd='dm')}" title="See more deathmatch rankings">More...</a></p>\r
111 </div>\r
112 \r
113 \r
114 \r
115 ##### TOP PLAYERS #####\r
116 <div class="table_block">\r
117 <h2>Most Active Players</h2>\r
118 <table id="top-players">\r
119         <thead>\r
120                 <tr>\r
121                         <th>#</th>\r
122                         <th>Nick</th>\r
123                         <th class="play-time">Play Time</th>\r
124                 </tr>\r
125         </thead>\r
126         <tbody>\r
127         <% i = 1 %>\r
128         % for (player_id, nick, alivetime) in top_players:\r
129                 <tr>\r
130                         <td>${i}</td>\r
131                         % if player_id != '-':\r
132                         <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>\r
133                         % else:\r
134                         <td>${nick}</td>\r
135                         % endif\r
136                         <td class="play-time">${alivetime}</td>\r
137                 </tr>\r
138                 <% i = i+1 %>\r
139         % endfor\r
140         </tbody>\r
141 </table>\r
142 <p class="note">*Most active stats are from the past 7 days</p>\r
143 </div>\r
144 \r
145 ##### TOP SERVERS #####\r
146 <div class="table_block">\r
147 <h2>Most Active Servers</h2>\r
148 <table id="top-servers">\r
149         <thead>\r
150                 <tr>\r
151                         <th>#</th>\r
152                         <th>Server</th>\r
153                         <th>Games</th>\r
154                 </tr>\r
155         </thead>\r
156         <tbody>\r
157         <% i = 1 %>\r
158         % for (server_id, name, count) in top_servers:\r
159                 <tr>\r
160                         <td>${i}</td>\r
161                         % if server_id != '-':\r
162                         <td><a href="${request.route_url('server_info', id=server_id)}" title="Go to the server info page for ${name}">${name}</a></td>\r
163                         % else:\r
164                         <td>${name}</td>\r
165                         % endif\r
166                         <td>${count}</td>\r
167                 </tr>\r
168                 <% i = i+1 %>\r
169         % endfor\r
170         </tbody>\r
171 </table>\r
172 </div>\r
173 \r
174 ##### TOP MAPS #####\r
175 <div class="table_block">\r
176 <h2>Most Active Maps</h2>\r
177 <table id="top-maps">\r
178         <thead>\r
179                 <tr>\r
180                         <th>#</th>\r
181                         <th>Map</th>\r
182                         <th>Games</th>\r
183                 </tr>\r
184         </thead>\r
185         <tbody>\r
186         <% i = 1 %>\r
187         % for (map_id, name, count) in top_maps:\r
188                 <tr>\r
189                         <td>${i}</td>\r
190                         % if map_id != '-':\r
191                         <td><a href="${request.route_url('map_info', id=map_id)}" title="Go to the map info page for ${name}">${name}</a></td>\r
192                         % else:\r
193                         <td>${name}</td>\r
194                         % endif\r
195                         <td>${count}</td>\r
196                 </tr>\r
197                 <% i = i+1 %>\r
198         % endfor\r
199         </tbody>\r
200 </table>\r
201 </div>\r
202 \r
203 \r
204 \r
205 ##### RECENT GAMES #####\r
206 <div class="table_block">\r
207 <h2>Recent Games</h2>\r
208 <table id="recent-games">\r
209         <thead>\r
210                 <tr>\r
211                         <th>Game #</th>\r
212                         <th>Type</th>\r
213                         <th>Server</th>\r
214                         <th>Map</th>\r
215                         <th>Time</th>\r
216                         <th>Winner</th>\r
217                 </tr>\r
218         </thead>\r
219         <tbody>\r
220         % for (game, server, map, pgstat) in recent_games:\r
221                 % if game != '-':\r
222                 <tr>\r
223                         <td><a href="${request.route_url('game_info', id=game.game_id)}" title="View detailed information about this game">${game.game_id}</a></td>\r
224                         <td class="gt_icon"><img title="${game.game_type_cd}" src="/static/images/icons/24x24/${game.game_type_cd}.png" alt="${game.game_type_cd}" /></td>\r
225                         <td><a href="${request.route_url('server_info', id=server.server_id)}" title="Go to the detail page for this server">${server.name}</a></td>\r
226                         <td><a href="${request.route_url('map_info', id=map.map_id)}" title="Go to the map detail page for this map">${map.name}</a></td>\r
227                         <td>${game.start_dt.strftime('%m/%d/%Y %H:%M')}</td>\r
228                         <td class=\r
229             % if pgstat.team == 5:\r
230             "blue"\r
231             % elif pgstat.team == 14:\r
232             "red"\r
233             % elif pgstat.team == 13:\r
234             "yellow"\r
235             % endif\r
236             >\r
237             % if pgstat.player_id > 2:\r
238             <a href="${request.route_url('player_info', id=pgstat.player_id)}" title="Go to the player info page for this player">${pgstat.nick_html_colors()|n}</a></td>\r
239             % else:\r
240             ${pgstat.nick_html_colors()|n}</td>\r
241             % endif\r
242                 </tr>\r
243                 % else:\r
244                 <tr>\r
245                         <td>-</td>\r
246                         <td>-</td>\r
247                         <td>-</td>\r
248                         <td>-</td>\r
249                         <td>-</td>\r
250                         <td>-</td>\r
251                 </tr>\r
252                 % endif\r
253     % endfor\r
254     </tbody>\r
255 </table>\r
256 </div>\r
257 \r
258 \r