]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/server_info.mako
5f54070f0e37eeb5c6eebb3df82d83aa570f2b26
[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 style="width:40px;">#</th>
42             <th style="width:150px;">Nick</th>
43             <th style="width:90px;">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 class="nostretch" style="max-width:150px;"><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 class="nostretch" style="max-width:150px;">${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 style="width:40px;">#</th>
71           <th style="width:150px;">Nick</th>
72           <th style="width:90px;">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 class="nostretch" style="max-width:150px;"><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 class="nostretch" style="max-width:150px;">${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 style="width:40px;">#</th>
100           <th style="width:150px;">Map</th>
101           <th style="width:120px;"># 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 class="nostretch" style="max-width:150px;"><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 class="nostretch" style="max-width:150px;">${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 <div class="row">
124   <div class="span12">
125     <p class="note">*Most active stats are from the past 7 days</p>
126   </div>
127 </div>
128
129
130 % if len(recent_games) > 0:
131 <div class="row">
132   <div class="span12">
133     <h3>Most Recent Games</h2>
134     <table class="table table-hover table-condensed">
135       <thead>
136         <tr>
137           <th></th>
138           <th>Type</th>
139           <th>Map</th>
140           <th>Time</th>
141           <th>Winner</th>
142         </tr>
143       </thead>
144       <tbody>
145         % for rg in recent_games:
146         <tr>
147           <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>
148           <td class="tdcenter"><span class="sprite sprite-${rg.game_type_cd}" alt="${rg.game_type_cd}" title="${rg.game_type_descr}"></span></td>
149           <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>
150           <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>
151           <td class="nostretch">
152             % if rg.player_id > 2:
153             <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>
154             % else:
155             ${rg.nick_html_colors|n}
156             % endif
157           </td>
158         </tr>
159         % endfor
160       </tbody>
161     </table>
162     <p><a href="${request.route_url('game_index', _query={'server_id':server.server_id})}">More...</a></p>
163   </div>
164 </div>
165 % endif
166
167
168 % endif