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