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