]> git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/map_info.mako
Sprite-ify the map and server info pages too.
[xonotic/xonstat.git] / xonstat / templates / map_info.mako
1 <%inherit file="base.mako"/>
2 <%namespace name="nav" file="nav.mako" />
3 <%namespace file="navlinks.mako" import="navlinks" />
4
5 <%block name="navigation">
6 ${nav.nav('maps')}
7 </%block>
8
9 <%block name="title">
10 % if gmap:
11 Map Information
12 % endif
13
14 ${parent.title()}
15 </%block>
16
17 <%block name="css">
18     ${parent.css()}
19     <link href="/static/css/sprites.css" rel="stylesheet">
20 </%block>
21
22 % if gmap is None:
23 <h2>Sorry, that map wasn't found!</h2>
24
25 % else:
26 <h2>${gmap.name}</h2>
27 <p>
28   Added <span class="abstime" data-epoch="${gmap.epoch()}" title="${gmap.create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${gmap.fuzzy_date()}</span>
29 </p>
30 <div class="row">
31   <div class="span4">
32     <h3>Top Scoring Players</h3>
33     <table class="table table-bordered table-condensed">
34       <thead>
35         <tr>
36           <th>#</th>
37           <th>Nick</th>
38           <th>Score</th>
39         </tr>
40       </thead>
41       <tbody>
42         <% i = 1 %>
43         % for (score_player_id, score_nick, score_value) in top_scorers:
44         <tr>
45           <td>${i}</td>
46           % if score_player_id != '-':
47           <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>
48           % else:
49           <td>${score_nick}</td>
50           % endif
51           <td>${score_value}</td>
52         </tr>
53         <% i = i+1 %>
54         % endfor
55         </tbody>
56     </table>
57   </div>
58
59
60 <div class="span4">
61   <h3>Most Active Players</h3>
62   <table class="table table-bordered table-condensed">
63     <thead>
64       <tr>
65         <th>#</th>
66         <th>Nick</th>
67         <th>Playing Time</th>
68       </tr>
69     </thead>
70     <tbody>
71     <% i = 1 %>
72     % for (player_id, nick, alivetime) in top_players:
73       <tr>
74         <td>${i}</td>
75         % if player_id != '-':
76         <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>
77         % else:
78         <td>${nick}</td>
79         % endif
80         <td>${alivetime}</td>
81       </tr>
82       <% i = i+1 %>
83     % endfor
84     </tbody>
85   </table>
86 </div>
87
88
89 <div class="span4">
90   <h3>Most Active Servers</h3>
91   <table class="table table-bordered table-condensed">
92     <thead>
93       <tr>
94         <th>#</th>
95         <th>Name</th>
96         <th>Times Played</th>
97       </tr>
98     </thead>
99     <tbody>
100     <% i = 1 %>
101     % for (server_id, name, times_played) in top_servers:
102       <tr>
103         <td>${i}</td>
104         <td><a href="${request.route_url('server_info', id=server_id)}" title="Go to the server info page for this server">${name}</a></td>
105         <td>${times_played}</td>
106       </tr>
107       <% i = i+1 %>
108     % endfor
109     </tbody>
110 </table>
111 </div>
112 </div> <!-- /row -->
113
114 % if len(captimes) > 0:
115 <div class="row">
116   <div class="span6">
117     <h3>Best Flag Capture Times</h3>
118     <table class="table table-bordered table-condensed">
119       <thead>
120         <tr>
121            <th>Nick</th>
122            <th>Captime</th>
123         </tr>
124       </thead>
125       <tbody>
126       % for c in captimes:
127         <tr>
128           <td>
129           % if c.player_id > 2:
130             <a href="${request.route_url("player_info", id=c.player_id)}"
131              title="Go to the info page for this player">
132             <span class="nick">${c.nick_html_colors|n}</span>
133             </a>
134           % else:
135             <span class="nick">${c.nick_html_colors|n}</span>
136           % endif
137           </td>
138           <td>
139             <a href="${request.route_url("game_info", id=c.game_id)}"
140              title="View the game in which this cap was made">
141               ${round(float(c.fastest_cap.seconds) + (c.fastest_cap.microseconds/1000000.0), 2)}
142             </a>
143           </td>
144         </tr>
145       % endfor
146       </tbody>
147     </table>
148   </div>
149 </div>
150 % endif
151
152
153 <div class="row">
154   <div class="span12">
155     <h3>Recent Games</h3>
156     <table class="table table-bordered table-condensed">
157       <thead>
158         <tr>
159           <th></th>
160           <th>Type</th>
161           <th>Server</th>
162           <th>Time</th>
163           <th>Winner</th>
164         </tr>
165       </thead>
166       <tbody>
167         % for rg in recent_games:
168         <tr>
169           <td><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>
170           <td><span class="sprite sprite-${rg.game_type_cd}" alt="${rg.game_type_cd}"></span></td>
171           <td><a href="${request.route_url('server_info', id=rg.server_id)}" title="Go to the detail page for this server">${rg.server_name}</a></td>
172           <td><span class="abstime" data-epoch="${rg.epoch}" title="${rg.create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${rg.fuzzy_date}</span></td>
173           <td>
174             % if rg.player_id > 2:
175             <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>
176             % else:
177             ${rg.nick_html_colors|n}
178             % endif
179           </td>
180         </tr>
181         % endfor
182       </tbody>
183     </table>
184   </div>
185 </div>
186
187
188 % endif