]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/server_info.mako
Gridify the player and server info pages.
[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
11 % endif
12 </%block>
13
14
15 % if server is None:
16 <h2>Sorry, that server wasn't found!</h2>
17
18 % else:
19 <div class="row">
20   <div class="span12">
21     <h2>${server.name}</h2>
22     <p>
23       IP Address: ${server.ip_addr} <br />
24       Revision: ${server.revision} <br />
25       Created: ${server.create_dt.strftime('%m/%d/%Y at %I:%M %p')} <br />
26     </p>
27   </div>
28 </div>
29
30
31 <div class="row">
32   <div class="span12">
33     <h3>Recent Games</h2>
34     <table class="table table-bordered table-condensed">
35       <thead>
36         <tr>
37           <th>Game #</th>
38           <th>Type</th>
39           <th>Map</th>
40           <th>Time</th>
41           <th>Winner</th>
42         </tr>
43       </thead>
44       <tbody>
45       % for (game, srv, map, pgstat) in recent_games:
46         % if game != '-':
47         <tr>
48           <td><a href="${request.route_url('game_info', id=game.game_id)}" title="View detailed information about this game">${game.game_id}</a></td>
49           <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>
50           <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>
51           <td>${game.start_dt.strftime('%m/%d/%Y %H:%M')}</td>
52           <td>
53           % if pgstat.player_id > 2:
54             <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>
55           </td>
56           % else:
57             ${pgstat.nick_html_colors()|n}
58           </td>
59           % endif
60         </tr>
61             % else:
62             <tr>
63               <td>-</td>
64               <td>-</td>
65               <td>-</td>
66               <td>-</td>
67               <td>-</td>
68             </tr>
69             % endif
70         % endfor
71         </tbody>
72     </table>
73   </div>
74 </div>
75
76
77 <div class="row">
78   <div class="span4">
79     <h3>Top Scoring Players</h3>
80       <table class="table table-bordered table-condensed">
81         <thead>
82           <tr>
83             <th>#</th>
84             <th>Nick</th>
85             <th>Score</th>
86           </tr>
87         </thead>
88         <tbody>
89         <% i = 1 %>
90         % for (score_player_id, score_nick, score_value) in top_scorers:
91           <tr>
92             <td>${i}</td>
93             % if score_player_id != '-':
94             <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>
95             % else:
96             <td>${score_nick}</td>
97             % endif
98             <td>${score_value}</td>
99           </tr>
100         <% i = i+1 %>
101         % endfor
102         </tbody>
103       </table>
104   </div> <!-- /span4 -->
105
106
107   <div class="span4">
108     <h3>Most Active Players</h3>
109     <table class="table table-bordered table-condensed">
110       <thead>
111         <tr>
112           <th>#</th>
113           <th>Nick</th>
114           <th>Playing Time</th>
115         </tr>
116       </thead>
117       <tbody>
118       <% i = 1 %>
119       % for (player_id, nick, alivetime) in top_players:
120         <tr>
121           <td>${i}</td>
122           % if player_id != '-':
123           <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>
124           % else:
125           <td>${nick}</td>
126           % endif
127           <td>${alivetime}</td>
128         </tr>
129         <% i = i+1 %>
130       % endfor
131       </tbody>
132     </table>
133   </div> <!-- /span4 -->
134
135
136   <div class="span4">
137     <h3>Most Active Maps</h3>
138     <table class="table table-bordered table-condensed">
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> <!-- /span4 -->
163
164 </div> <!-- /row -->
165
166 % endif