]> git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/server_info.mako
Add a server leaderboard of sorts.
[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
71 ##### TOP PLAYERS #####
72 <div class="table_block">
73 <h2>Most Active Players</h2>
74 <table id="top-players">
75         <thead>
76                 <tr>
77                         <th>#</th>
78                         <th>Nick</th>
79                         <th>Playing Time</th>
80                 </tr>
81         </thead>
82         <tbody>
83         <% i = 1 %>
84         % for (player_id, nick, alivetime) in top_players:
85                 <tr>
86                         <td>${i}</td>
87                         % if player_id != '-':
88                         <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>
89                         % else:
90                         <td>${nick}</td>
91                         % endif
92                         <td>${alivetime}</td>
93                 </tr>
94                 <% i = i+1 %>
95         % endfor
96         </tbody>
97 </table>
98 </div>
99
100
101 ##### TOP MAPS #####
102 <div class="table_block">
103 <h2>Most Active Maps</h2>
104 <table id="top-maps">
105         <thead>
106                 <tr>
107                         <th>#</th>
108                         <th>Map</th>
109                         <th># Games</th>
110                 </tr>
111         </thead>
112         <tbody>
113         <% i = 1 %>
114         % for (map_id, name, count) in top_maps:
115                 <tr>
116                         <td>${i}</td>
117                         % if map_id != '-':
118                         <td><a href="${request.route_url('map_info', id=map_id)}" title="Go to the map info page for ${name}">${name}</a></td>
119                         % else:
120                         <td>${name}</td>
121                         % endif
122                         <td>${count}</td>
123                 </tr>
124                 <% i = i+1 %>
125         % endfor
126         </tbody>
127 </table>
128 </div>
129
130 % endif