Show server port, if available.
[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: 
28       % if server.port is not None:
29       ${server.ip_addr}:${server.port}
30       % else:
31       ${server.ip_addr}
32       % endif
33       <br />
34       Revision: ${server.revision} <br />
35       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 />
36     </p>
37   </div>
38 </div>
39
40
41 <div class="row">
42   <div class="span4">
43     <h3>Top Scoring Players</h3>
44       <table class="table table-hover table-condensed">
45         <thead>
46           <tr>
47             <th style="width:40px;">#</th>
48             <th style="width:150px;">Nick</th>
49             <th style="width:90px;">Score</th>
50           </tr>
51         </thead>
52         <tbody>
53         <% i = 1 %>
54         % for (score_player_id, score_nick, score_value) in top_scorers:
55           <tr>
56             <td>${i}</td>
57             % if score_player_id != '-':
58             <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>
59             % else:
60             <td class="nostretch" style="max-width:150px;">${score_nick}</td>
61             % endif
62             <td>${score_value}</td>
63           </tr>
64         <% i = i+1 %>
65         % endfor
66         </tbody>
67       </table>
68   </div> <!-- /span4 -->
69
70
71   <div class="span4">
72     <h3>Most Active Players</h3>
73     <table class="table table-hover table-condensed">
74       <thead>
75         <tr>
76           <th style="width:40px;">#</th>
77           <th style="width:150px;">Nick</th>
78           <th style="width:90px;">Playing Time</th>
79         </tr>
80       </thead>
81       <tbody>
82       <% i = 1 %>
83       % for (player_id, nick, alivetime) in top_players:
84         <tr>
85           <td>${i}</td>
86           % if player_id != '-':
87           <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>
88           % else:
89           <td class="nostretch" style="max-width:150px;">${nick}</td>
90           % endif
91           <td>${alivetime}</td>
92         </tr>
93         <% i = i+1 %>
94       % endfor
95       </tbody>
96     </table>
97   </div> <!-- /span4 -->
98
99
100   <div class="span4">
101     <h3>Most Active Maps</h3>
102     <table class="table table-hover table-condensed">
103       <thead>
104         <tr>
105           <th style="width:40px;">#</th>
106           <th style="width:150px;">Map</th>
107           <th style="width:120px;"># Games</th>
108         </tr>
109       </thead>
110       <tbody>
111       <% i = 1 %>
112       % for (map_id, name, count) in top_maps:
113         <tr>
114           <td>${i}</td>
115           % if map_id != '-':
116           <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>
117           % else:
118           <td class="nostretch" style="max-width:150px;">${name}</td>
119           % endif
120           <td>${count}</td>
121         </tr>
122         <% i = i+1 %>
123       % endfor
124       </tbody>
125     </table>
126   </div> <!-- /span4 -->
127
128 </div> <!-- /row -->
129 <div class="row">
130   <div class="span12">
131     <p class="note">*Most active stats are from the past 7 days</p>
132   </div>
133 </div>
134
135
136 % if len(recent_games) > 0:
137 <div class="row">
138   <div class="span12">
139     <h3>Most Recent Games</h2>
140     <table class="table table-hover table-condensed">
141       <thead>
142         <tr>
143           <th></th>
144           <th>Type</th>
145           <th>Map</th>
146           <th>Time</th>
147           <th>Winner</th>
148         </tr>
149       </thead>
150       <tbody>
151         % for rg in recent_games:
152         <tr>
153           <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>
154           <td class="tdcenter"><span class="sprite sprite-${rg.game_type_cd}" alt="${rg.game_type_cd}" title="${rg.game_type_descr}"></span></td>
155           <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>
156           <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>
157           <td class="nostretch">
158             % if rg.player_id > 2:
159             <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>
160             % else:
161             ${rg.nick_html_colors|n}
162             % endif
163           </td>
164         </tr>
165         % endfor
166       </tbody>
167     </table>
168     <p><a href="${request.route_url('game_index', _query={'server_id':server.server_id})}">More...</a></p>
169   </div>
170 </div>
171 % endif
172
173
174 % endif