]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/server_info.mako
Bundle in Luma.
[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 % if server is None:
15   <h2>Sorry, that server wasn't found!</h2>
16
17 % else:
18   <div class="row">
19     <div class="small-12 columns">
20       <h2>${server.name}</h2>
21       <p>
22         IP Address: 
23         % if server.port is not None:
24         ${server.ip_addr}:${server.port}
25         % else:
26         ${server.ip_addr}
27         % endif
28         <br />
29         Revision: ${server.revision} <br />
30         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 />
31       </p>
32     </div>
33   </div>
34
35
36   <div class="row">
37     <div class="small-12 large-4 columns">
38       <h5>Top Scoring Players</h5>
39       <table class="table-hover table-condensed">
40         <thead>
41           <tr>
42             <th style="small-2">#</th>
43             <th style="small-7">Nick</th>
44             <th style="small-3">Score</th>
45           </tr>
46         </thead>
47         <tbody>
48         <% i = 1 %>
49         % for (score_player_id, score_nick, score_value) in top_scorers:
50           <tr>
51             <td>${i}</td>
52             % if score_player_id != '-':
53               <td class="no-stretch"><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>
54             % else:
55               <td class="no-stretch">${score_nick}</td>
56             % endif
57             <td>${score_value}</td>
58           </tr>
59           <% i = i+1 %>
60         % endfor
61         </tbody>
62       </table>
63     </div>
64
65     <div class="small-12 large-4 columns">
66       <h5>Most Active Players</h5>
67       <table class="table-hover table-condensed">
68         <thead>
69           <tr>
70             <th style="small-2">#</th>
71             <th style="small-7">Nick</th>
72             <th style="small-3">Play 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="no-stretch"><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="no-stretch">${nick}</td>
84             % endif
85             <td>${alivetime}</td>
86           </tr>
87           <% i = i+1 %>
88         % endfor
89         </tbody>
90       </table>
91     </div>
92
93     <div class="small-12 large-4 columns">
94       <h5>Most Active Maps</h5>
95       <table class="table-hover table-condensed">
96         <thead>
97           <tr>
98             <th style="small-2">#</th>
99             <th style="small-7">Map</th>
100             <th style="small-3"># Games</th>
101           </tr>
102         </thead>
103         <tbody>
104         <% i = 1 %>
105         % for (map_id, name, count) in top_maps:
106           <tr>
107             <td>${i}</td>
108             % if map_id != '-':
109               <td class="no-stretch"><a href="${request.route_url('map_info', id=map_id)}" title="Go to the map info page for ${name}">${name}</a></td>
110             % else:
111               <td class="no-stretch">${name}</td>
112             % endif
113             <td>${count}</td>
114           </tr>
115           <% i = i+1 %>
116         % endfor
117         </tbody>
118       </table>
119     </div> 
120   </div>
121
122   <div class="row">
123     <div class="small-12 columns">
124       <small>*Most active stats are from the past 7 days</small>
125     </div>
126   </div>
127
128
129   % if len(recent_games) > 0:
130     <div class="row">
131       <div class="small-12 columns">
132         <h5>Most Recent Games</h5>
133         <table class="table-hover table-condensed">
134           <thead>
135             <tr>
136               <th class="small-1 text-center"></th>
137               <th class="small-1">Type</th>
138               <th class="show-for-medium-up small-3">Map</th>
139               <th class="show-for-large-up small-3">Time</th>
140               <th class="small-3">Winner</th>
141             </tr>
142           </thead>
143           <tbody>
144             % for rg in recent_games:
145             <tr>
146               <td class="text-center"><a class="tiny button" href="${request.route_url('game_info', id=rg.game_id)}" title="View detailed information about this game">View</a></td>
147               <td class="text-center"><span class="sprite sprite-${rg.game_type_cd}" alt="${rg.game_type_cd}" title="${rg.game_type_descr}"></span></td>
148               <td class="show-for-medium-up"><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>
149               <td class="show-for-large-up"><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>
150               <td class="no-stretch">
151                 % if rg.player_id > 2:
152                 <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>
153                 % else:
154                 ${rg.nick_html_colors|n}
155                 % endif
156               </td>
157             </tr>
158             % endfor
159           </tbody>
160         </table>
161         <p><a href="${request.route_url('game_index', _query={'server_id':server.server_id})}">More...</a></p>
162       </div>
163     </div>
164   % endif
165 % endif