01e4868ae585e1c6a05c8b7be5de5fc685b1d28b
[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 <div id="leaderboard">\r
8 \r
9 ##### TOP PLAYERS #####\r
10 <table id="top-players" border="1">\r
11     <tr>\r
12         <th colspan="3">Top Players</th>\r
13     </tr>\r
14     <tr>\r
15         <th>#</th>\r
16         <th>Nick</th>\r
17         <th>Score</th>\r
18     </tr>\r
19 <% i = 1 %>\r
20 % for (player_id, nick, score) in top_players:\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|n}</a></td>\r
25         % else:\r
26         <td>${nick}</td>\r
27         % endif\r
28         <td>${score}</td>\r
29     </tr>\r
30     <% i = i+1 %>\r
31 % endfor\r
32 </table>\r
33 \r
34 ##### TOP SERVERS #####\r
35 <table id="top-servers" border="1">\r
36     <tr>\r
37         <th colspan="3">Top Servers</th>\r
38     </tr>\r
39     <tr>\r
40         <th>#</th>\r
41         <th>Server</th>\r
42         <th>Games</th>\r
43     </tr>\r
44 <% i = 1 %>\r
45 % for (server_id, name, count) in top_servers:\r
46     <tr>\r
47         <td>${i}</td>\r
48         % if server_id != '-':\r
49         <td><a href="${request.route_url('server_info', id=server_id)}" title="Go to the server info page for ${name}">${name}</a></td>\r
50         % else:\r
51         <td>${name}</td>\r
52         % endif\r
53         <td>${count}</td>\r
54     </tr>\r
55     <% i = i+1 %>\r
56 % endfor\r
57 </table>\r
58 \r
59 ##### TOP MAPS #####\r
60 <table id="top-maps" border="1">\r
61     <tr>\r
62         <th colspan="3">Top Maps</th>\r
63     </tr>\r
64     <tr>\r
65         <th>#</th>\r
66         <th>Map</th>\r
67         <th>Times Played</th>\r
68     </tr>\r
69 <% i = 1 %>\r
70 % for (map_id, name, count) in top_maps:\r
71     <tr>\r
72         <td>${i}</td>\r
73         % if map_id != '-':\r
74         <td><a href="${request.route_url('map_info', id=map_id)}" title="Go to the map info page for ${name}">${name}</a></td>\r
75         % else:\r
76         <td>${name}</td>\r
77         % endif\r
78         <td>${count}</td>\r
79     </tr>\r
80     <% i = i+1 %>\r
81 % endfor\r
82 </table>\r
83 </div> <!-- END LEADERBOARD -->\r
84 \r
85 <div id="recent-games">\r
86 \r
87 ##### RECENT GAMES #####\r
88 <table id="recent-games-table" border="1">\r
89     <tr>\r
90         <th colspan="5">Recent Games</th>\r
91     </tr>\r
92     <tr>\r
93         <th>Game #</th>\r
94         <th>Type</th>\r
95         <th>Server</th>\r
96         <th>Map</th>\r
97         <th>Time</th>\r
98         <th>Winner</th>\r
99     </tr>\r
100     % for (game, server, map) in recent_games:\r
101     % if game != '-':\r
102     <tr>\r
103         <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
104         <td>${game.game_type_cd}</td>\r
105         <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
106         <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
107         <td>${game.start_dt.strftime('%m/%d/%Y %H:%M')}</td>\r
108         <td>${game.winner}</td>\r
109     </tr>\r
110     % else:\r
111     <tr>\r
112         <td>-</td>\r
113         <td>-</td>\r
114         <td>-</td>\r
115         <td>-</td>\r
116         <td>-</td>\r
117         <td>-</td>\r
118     </tr>\r
119     % endif\r
120     % endfor\r
121 </table>\r
122 </div> <!-- END RECENT GAMES -->\r