]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/main_index.mako
Merge branch 'master' of github.com:antzucaro/XonStat
[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 \r
8 ##### RECENT GAMES #####\r
9 <h2>Recent Games</h2>\r
10 <table id="recent-games">\r
11         <thead>\r
12                 <tr>\r
13                         <th>Game #</th>\r
14                         <th>Type</th>\r
15                         <th>Server</th>\r
16                         <th>Map</th>\r
17                         <th>Time</th>\r
18                         <th>Winner</th>\r
19                 </tr>\r
20         </thead>\r
21         <tbody>\r
22         % for (game, server, map, pgstat) in recent_games:\r
23                 % if game != '-':\r
24                 <tr>\r
25                         <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
26                         <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
27                         <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
28                         <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
29                         <td>${game.start_dt.strftime('%m/%d/%Y %H:%M')}</td>\r
30                         <td class=\r
31             % if pgstat.team == 5:\r
32             "blue"\r
33             % elif pgstat.team == 14:\r
34             "red"\r
35             % elif pgstat.team == 13:\r
36             "yellow"\r
37             % endif\r
38             >\r
39             % if pgstat.player_id > 2:\r
40             <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()}</a></td>\r
41             % else:\r
42             ${pgstat.nick_html_colors()}</td>\r
43             % endif\r
44                 </tr>\r
45                 % else:\r
46                 <tr>\r
47                         <td>-</td>\r
48                         <td>-</td>\r
49                         <td>-</td>\r
50                         <td>-</td>\r
51                         <td>-</td>\r
52                         <td>-</td>\r
53                 </tr>\r
54                 % endif\r
55     % endfor\r
56     </tbody>\r
57 </table>\r
58 \r
59 ##### TOP PLAYERS #####\r
60 <div class="table_block">\r
61 <h2>Top Players</h2>\r
62 <table id="top-players">\r
63         <thead>\r
64                 <tr>\r
65                         <th>#</th>\r
66                         <th>Nick</th>\r
67                         <th>Score</th>\r
68                 </tr>\r
69         </thead>\r
70         <tbody>\r
71         <% i = 1 %>\r
72         % for (player_id, nick, score) in top_players:\r
73                 <tr>\r
74                         <td>${i}</td>\r
75                         % if player_id != '-':\r
76                         <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
77                         % else:\r
78                         <td>${nick}</td>\r
79                         % endif\r
80                         <td>${score}</td>\r
81                 </tr>\r
82                 <% i = i+1 %>\r
83         % endfor\r
84         </tbody>\r
85 </table>\r
86 </div>\r
87 \r
88 ##### TOP SERVERS #####\r
89 <div class="table_block">\r
90 <h2>Top Servers</h2>\r
91 <table id="top-servers">\r
92         <thead>\r
93                 <tr>\r
94                         <th>#</th>\r
95                         <th>Server</th>\r
96                         <th>Games</th>\r
97                 </tr>\r
98         </thead>\r
99         <tbody>\r
100         <% i = 1 %>\r
101         % for (server_id, name, count) in top_servers:\r
102                 <tr>\r
103                         <td>${i}</td>\r
104                         % if server_id != '-':\r
105                         <td><a href="${request.route_url('server_info', id=server_id)}" title="Go to the server info page for ${name}">${name}</a></td>\r
106                         % else:\r
107                         <td>${name}</td>\r
108                         % endif\r
109                         <td>${count}</td>\r
110                 </tr>\r
111                 <% i = i+1 %>\r
112         % endfor\r
113         </tbody>\r
114 </table>\r
115 </div>\r
116 \r
117 ##### TOP MAPS #####\r
118 <div class="table_block">\r
119 <h2>Top Maps</h2>\r
120 <table id="top-maps">\r
121         <thead>\r
122                 <tr>\r
123                         <th>#</th>\r
124                         <th>Map</th>\r
125                         <th>Times Played</th>\r
126                 </tr>\r
127         </thead>\r
128         <tbody>\r
129         <% i = 1 %>\r
130         % for (map_id, name, count) in top_maps:\r
131                 <tr>\r
132                         <td>${i}</td>\r
133                         % if map_id != '-':\r
134                         <td><a href="${request.route_url('map_info', id=map_id)}" title="Go to the map info page for ${name}">${name}</a></td>\r
135                         % else:\r
136                         <td>${name}</td>\r
137                         % endif\r
138                         <td>${count}</td>\r
139                 </tr>\r
140                 <% i = i+1 %>\r
141         % endfor\r
142         </tbody>\r
143 </table>\r
144 </div>\r