]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/server_info.mako
Fix the ordering of things and the view game links.
[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       Added on ${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="span4">
33     <h3>Top Scoring Players</h3>
34       <table class="table table-bordered table-condensed">
35         <thead>
36           <tr>
37             <th>#</th>
38             <th>Nick</th>
39             <th>Score</th>
40           </tr>
41         </thead>
42         <tbody>
43         <% i = 1 %>
44         % for (score_player_id, score_nick, score_value) in top_scorers:
45           <tr>
46             <td>${i}</td>
47             % if score_player_id != '-':
48             <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>
49             % else:
50             <td>${score_nick}</td>
51             % endif
52             <td>${score_value}</td>
53           </tr>
54         <% i = i+1 %>
55         % endfor
56         </tbody>
57       </table>
58   </div> <!-- /span4 -->
59
60
61   <div class="span4">
62     <h3>Most Active Players</h3>
63     <table class="table table-bordered table-condensed">
64       <thead>
65         <tr>
66           <th>#</th>
67           <th>Nick</th>
68           <th>Playing Time</th>
69         </tr>
70       </thead>
71       <tbody>
72       <% i = 1 %>
73       % for (player_id, nick, alivetime) in top_players:
74         <tr>
75           <td>${i}</td>
76           % if player_id != '-':
77           <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>
78           % else:
79           <td>${nick}</td>
80           % endif
81           <td>${alivetime}</td>
82         </tr>
83         <% i = i+1 %>
84       % endfor
85       </tbody>
86     </table>
87   </div> <!-- /span4 -->
88
89
90   <div class="span4">
91     <h3>Most Active Maps</h3>
92     <table class="table table-bordered table-condensed">
93       <thead>
94         <tr>
95           <th>#</th>
96           <th>Map</th>
97           <th># Games</th>
98         </tr>
99       </thead>
100       <tbody>
101       <% i = 1 %>
102       % for (map_id, name, count) in top_maps:
103         <tr>
104           <td>${i}</td>
105           % if map_id != '-':
106           <td><a href="${request.route_url('map_info', id=map_id)}" title="Go to the map info page for ${name}">${name}</a></td>
107           % else:
108           <td>${name}</td>
109           % endif
110           <td>${count}</td>
111         </tr>
112         <% i = i+1 %>
113       % endfor
114       </tbody>
115     </table>
116   </div> <!-- /span4 -->
117
118 </div> <!-- /row -->
119
120
121
122 <div class="row">
123   <div class="span12">
124     <h3>Recent Games</h2>
125     <table class="table table-bordered table-condensed">
126       <thead>
127         <tr>
128           <th></th>
129           <th>Type</th>
130           <th>Map</th>
131           <th>Time</th>
132           <th>Winner</th>
133         </tr>
134       </thead>
135       <tbody>
136       % for (game, srv, map, pgstat) in recent_games:
137         % if game != '-':
138         <tr>
139           <td><a class="btn btn-primary btn-small" href="${request.route_url('game_info', id=game.game_id)}" title="View detailed information about this game">View</a></td>
140           <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>
141           <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>
142           <td>${game.start_dt.strftime('%m/%d/%Y %H:%M')}</td>
143           <td>
144           % if pgstat.player_id > 2:
145             <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>
146           </td>
147           % else:
148             ${pgstat.nick_html_colors()|n}
149           </td>
150           % endif
151         </tr>
152             % else:
153             <tr>
154               <td>-</td>
155               <td>-</td>
156               <td>-</td>
157               <td>-</td>
158               <td>-</td>
159             </tr>
160             % endif
161         % endfor
162         </tbody>
163     </table>
164   </div>
165 </div>
166
167
168 % endif