]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/map_info.mako
Add a "leaderboard"-like view to the map info page.
[xonotic/xonstat.git] / xonstat / templates / map_info.mako
1 <%inherit file="base.mako"/>
2
3 <%block name="title">
4 % if gmap:
5 Map Information for ${gmap.name} - 
6 % endif
7
8 ${parent.title()}
9 </%block>
10
11
12 % if gmap is None:
13 <h2>Sorry, that map wasn't found!</h2>
14
15 % else:
16 <h2>Map Detail - ${gmap.name}</h2>
17
18 ##### RECENT GAMES #####
19 <h2>Recent Games</h2>
20 <table id="recent-games">
21     <thead>
22         <tr>
23             <th>Game #</th>
24             <th>Type</th>
25             <th>Time</th>
26             <th>Winner</th>
27         </tr>
28     </thead>
29     <tbody>
30     % for (game, srv, map, pgstat) in recent_games:
31         % if game != '-':
32         <tr>
33             <td><a href="${request.route_url('game_info', id=game.game_id)}" title="View detailed information about this game">${game.game_id}</a></td>
34             <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>
35             <td>${game.start_dt.strftime('%m/%d/%Y %H:%M')}</td>
36             <td class=
37             % if pgstat.team == 5:
38             "blue"
39             % elif pgstat.team == 14:
40             "red"
41             % elif pgstat.team == 13:
42             "yellow"
43             % endif
44             >
45             % if pgstat.player_id > 2:
46             <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>
47             % else:
48             ${pgstat.nick_html_colors()|n}</td>
49             % endif
50         </tr>
51         % else:
52         <tr>
53             <td>-</td>
54             <td>-</td>
55             <td>-</td>
56             <td>-</td>
57         </tr>
58         % endif
59     % endfor
60     </tbody>
61 </table>
62
63
64 ##### TOP SCORERS #####
65 <div class="table_block">
66 <h2>Top Scoring Players</h2>
67 <table>
68     <thead>
69         <tr>
70             <th>#</th>
71             <th>Nick</th>
72             <th>Score</th>
73         </tr>
74     </thead>
75     <tbody>
76     <% i = 1 %>
77     % for (score_player_id, score_nick, score_value) in top_scorers:
78         <tr>
79             <td>${i}</td>
80             % if score_player_id != '-':
81             <td><a href="${request.route_url('player_info', id=score_player_id)}" title="Go to the player info page for this player">${score_nick|n}</a></td>
82             % else:
83             <td>${score_nick}</td>
84             % endif
85             <td>${score_value}</td>
86         </tr>
87         <% i = i+1 %>
88     % endfor
89     </tbody>
90 </table>
91 </div>
92
93
94 ##### TOP PLAYERS #####
95 <div class="table_block">
96 <h2>Most Active Players</h2>
97 <table id="top-players">
98     <thead>
99         <tr>
100             <th>#</th>
101             <th>Nick</th>
102             <th>Playing Time</th>
103         </tr>
104     </thead>
105     <tbody>
106     <% i = 1 %>
107     % for (player_id, nick, alivetime) in top_players:
108         <tr>
109             <td>${i}</td>
110             % if player_id != '-':
111             <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>
112             % else:
113             <td>${nick}</td>
114             % endif
115             <td>${alivetime}</td>
116         </tr>
117         <% i = i+1 %>
118     % endfor
119     </tbody>
120 </table>
121 </div>
122
123
124 ##### TOP SERVERS #####
125 <div class="table_block">
126 <h2>Most Active Servers</h2>
127 <table id="top-servers">
128     <thead>
129         <tr>
130             <th>#</th>
131             <th>Name</th>
132             <th>Times Played</th>
133         </tr>
134     </thead>
135     <tbody>
136     <% i = 1 %>
137     % for (server_id, name, times_played) in top_servers:
138         <tr>
139             <td>${i}</td>
140             <td><a href="${request.route_url('server_info', id=server_id)}" title="Go to the server info page for this server">${name}</a></td>
141             <td>${times_played}</td>
142         </tr>
143         <% i = i+1 %>
144     % endfor
145     </tbody>
146 </table>
147 </div>
148
149
150 % endif