5c2cf73d4f770d18562ae447a4d0d7e164af9876
[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       <p class="note">*Most active stats are from the past 7 days</p>
63   </div> <!-- /span4 -->
64
65
66   <div class="span4">
67     <h3>Most Active Players</h3>
68     <table class="table table-hover table-condensed">
69       <thead>
70         <tr>
71           <th>#</th>
72           <th>Nick</th>
73           <th>Playing Time</th>
74         </tr>
75       </thead>
76       <tbody>
77       <% i = 1 %>
78       % for (player_id, nick, alivetime) in top_players:
79         <tr>
80           <td>${i}</td>
81           % if player_id != '-':
82           <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>
83           % else:
84           <td>${nick}</td>
85           % endif
86           <td>${alivetime}</td>
87         </tr>
88         <% i = i+1 %>
89       % endfor
90       </tbody>
91     </table>
92   </div> <!-- /span4 -->
93
94
95   <div class="span4">
96     <h3>Most Active Maps</h3>
97     <table class="table table-hover table-condensed">
98       <thead>
99         <tr>
100           <th>#</th>
101           <th>Map</th>
102           <th># Games</th>
103         </tr>
104       </thead>
105       <tbody>
106       <% i = 1 %>
107       % for (map_id, name, count) in top_maps:
108         <tr>
109           <td>${i}</td>
110           % if map_id != '-':
111           <td><a href="${request.route_url('map_info', id=map_id)}" title="Go to the map info page for ${name}">${name}</a></td>
112           % else:
113           <td>${name}</td>
114           % endif
115           <td>${count}</td>
116         </tr>
117         <% i = i+1 %>
118       % endfor
119       </tbody>
120     </table>
121   </div> <!-- /span4 -->
122
123 </div> <!-- /row -->
124
125
126
127 % if len(recent_games) > 0:
128 <div class="row">
129   <div class="span12">
130     <h3>Most Recent Games</h2>
131     <table class="table table-hover table-condensed">
132       <thead>
133         <tr>
134           <th></th>
135           <th>Type</th>
136           <th>Map</th>
137           <th>Time</th>
138           <th>Winner</th>
139         </tr>
140       </thead>
141       <tbody>
142         % for rg in recent_games:
143         <tr>
144           <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>
145           <td class="tdcenter"><span class="sprite sprite-${rg.game_type_cd}" alt="${rg.game_type_cd}" title="${rg.game_type_descr}"></span></td>
146           <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>
147           <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>
148           <td>
149             % if rg.player_id > 2:
150             <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>
151             % else:
152             ${rg.nick_html_colors|n}
153             % endif
154           </td>
155         </tr>
156         % endfor
157       </tbody>
158     </table>
159     <p><a href="${request.route_url('game_finder', _query={'server_id':server.server_id})}">More...</a></p>
160   </div>
161 </div>
162 % endif
163
164
165 % endif