ac0f90ee32bdf2579b0fdf6e2b4ef863a46f681c
[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 <%block name="css">
15     ${parent.css()}
16     <link href="/static/css/sprites.css" rel="stylesheet">
17 </%block>
18
19 % if server is None:
20 <h2>Sorry, that server wasn't found!</h2>
21
22 % else:
23 <div class="row">
24   <div class="span12">
25     <h2>${server.name}</h2>
26     <p>
27       IP Address: ${server.ip_addr} <br />
28       Revision: ${server.revision} <br />
29       Added <span class="abstime" data-epoch="${server.epoch()}" title="${server.create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${server.fuzzy_date()}</span> <br />
30     </p>
31   </div>
32 </div>
33
34
35 <div class="row">
36   <div class="span4">
37     <h3>Top Scoring Players</h3>
38       <table class="table table-hover table-condensed">
39         <thead>
40           <tr>
41             <th>#</th>
42             <th>Nick</th>
43             <th>Score</th>
44           </tr>
45         </thead>
46         <tbody>
47         <% i = 1 %>
48         % for (score_player_id, score_nick, score_value) in top_scorers:
49           <tr>
50             <td>${i}</td>
51             % if score_player_id != '-':
52             <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>
53             % else:
54             <td>${score_nick}</td>
55             % endif
56             <td>${score_value}</td>
57           </tr>
58         <% i = i+1 %>
59         % endfor
60         </tbody>
61       </table>
62   </div> <!-- /span4 -->
63
64
65   <div class="span4">
66     <h3>Most Active Players</h3>
67     <table class="table table-hover table-condensed">
68       <thead>
69         <tr>
70           <th>#</th>
71           <th>Nick</th>
72           <th>Playing Time</th>
73         </tr>
74       </thead>
75       <tbody>
76       <% i = 1 %>
77       % for (player_id, nick, alivetime) in top_players:
78         <tr>
79           <td>${i}</td>
80           % if player_id != '-':
81           <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>
82           % else:
83           <td>${nick}</td>
84           % endif
85           <td>${alivetime}</td>
86         </tr>
87         <% i = i+1 %>
88       % endfor
89       </tbody>
90     </table>
91   </div> <!-- /span4 -->
92
93
94   <div class="span4">
95     <h3>Most Active Maps</h3>
96     <table class="table table-hover table-condensed">
97       <thead>
98         <tr>
99           <th>#</th>
100           <th>Map</th>
101           <th># Games</th>
102         </tr>
103       </thead>
104       <tbody>
105       <% i = 1 %>
106       % for (map_id, name, count) in top_maps:
107         <tr>
108           <td>${i}</td>
109           % if map_id != '-':
110           <td><a href="${request.route_url('map_info', id=map_id)}" title="Go to the map info page for ${name}">${name}</a></td>
111           % else:
112           <td>${name}</td>
113           % endif
114           <td>${count}</td>
115         </tr>
116         <% i = i+1 %>
117       % endfor
118       </tbody>
119     </table>
120   </div> <!-- /span4 -->
121
122 </div> <!-- /row -->
123
124
125
126 % if len(recent_games) > 0:
127 <div class="row">
128   <div class="span12">
129     <h3>Most Recent Games</h2>
130     <table class="table table-hover table-condensed">
131       <thead>
132         <tr>
133           <th></th>
134           <th>Type</th>
135           <th>Map</th>
136           <th>Time</th>
137           <th>Winner</th>
138         </tr>
139       </thead>
140       <tbody>
141         % for rg in recent_games:
142         <tr>
143           <td class="tdcenter"><a class="btn btn-primary btn-small" href="${request.route_url('game_info', id=rg.game_id)}" title="View detailed information about this game">View</a></td>
144           <td class="tdcenter"><span class="sprite sprite-${rg.game_type_cd}" alt="${rg.game_type_cd}" title="${rg.game_type_descr}"></span></td>
145           <td><a href="${request.route_url('map_info', id=rg.map_id)}" title="Go to the map detail page for this map">${rg.map_name}</a></td>
146           <td><span class="abstime" data-epoch="${rg.epoch}" title="${rg.start_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${rg.fuzzy_date}</span></td>
147           <td>
148             % if rg.player_id > 2:
149             <a href="${request.route_url('player_info', id=rg.player_id)}" title="Go to the player info page for this player">${rg.nick_html_colors|n}</a>
150             % else:
151             ${rg.nick_html_colors|n}
152             % endif
153           </td>
154         </tr>
155         % endfor
156       </tbody>
157     </table>
158     <p><a href="${request.route_url('game_finder', _query={'server_id':server.server_id})}">More...</a></p>
159   </div>
160 </div>
161 % endif
162
163
164 % endif