9e872b5a3776898589c1cef5080b36429e85b0a9
[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-hover 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     <p class="note">*Most active stats are from the past 7 days</p>
58   </div>
59
60
61 <div class="span4">
62   <h3>Most Active Players</h3>
63   <table class="table table-hover table-condensed">
64     <thead>
65       <tr>
66         <th>#</th>
67         <th>Nick</th>
68         <th>Playing Time</th>
69       </tr>
70     </thead>
71     <tbody>
72     <% i = 1 %>
73     % for (player_id, nick, alivetime) in top_players:
74       <tr>
75         <td>${i}</td>
76         % if player_id != '-':
77         <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>
78         % else:
79         <td>${nick}</td>
80         % endif
81         <td>${alivetime}</td>
82       </tr>
83       <% i = i+1 %>
84     % endfor
85     </tbody>
86   </table>
87 </div>
88
89
90 <div class="span4">
91   <h3>Most Active Servers</h3>
92   <table class="table table-hover table-condensed">
93     <thead>
94       <tr>
95         <th>#</th>
96         <th>Name</th>
97         <th>Times Played</th>
98       </tr>
99     </thead>
100     <tbody>
101     <% i = 1 %>
102     % for (server_id, name, times_played) in top_servers:
103       <tr>
104         <td>${i}</td>
105         <td><a href="${request.route_url('server_info', id=server_id)}" title="Go to the server info page for this server">${name}</a></td>
106         <td>${times_played}</td>
107       </tr>
108       <% i = i+1 %>
109     % endfor
110     </tbody>
111 </table>
112 </div>
113 </div> <!-- /row -->
114
115 % if len(captimes) > 0:
116 <div class="row">
117   <div class="span6">
118     <h3>Best Flag Capture Times</h3>
119     <table class="table table-hover table-condensed">
120       <thead>
121         <tr>
122            <th>Nick</th>
123            <th>Captime</th>
124         </tr>
125       </thead>
126       <tbody>
127       % for c in captimes:
128         <tr>
129           <td>
130           % if c.player_id > 2:
131             <a href="${request.route_url("player_info", id=c.player_id)}"
132              title="Go to the info page for this player">
133             <span class="nick">${c.nick_html_colors|n}</span>
134             </a>
135           % else:
136             <span class="nick">${c.nick_html_colors|n}</span>
137           % endif
138           </td>
139           <td>
140             <a href="${request.route_url("game_info", id=c.game_id)}"
141              title="View the game in which this cap was made">
142               ${round(float(c.fastest_cap.seconds) + (c.fastest_cap.microseconds/1000000.0), 2)}
143             </a>
144           </td>
145         </tr>
146       % endfor
147       </tbody>
148     </table>
149   </div>
150 </div>
151 % endif
152
153
154 % if len(recent_games) > 0:
155 <div class="row">
156   <div class="span12">
157     <h3>Most Recent Games</h3>
158     <table class="table table-hover table-condensed">
159       <thead>
160         <tr>
161           <th></th>
162           <th>Type</th>
163           <th>Server</th>
164           <th>Time</th>
165           <th>Winner</th>
166         </tr>
167       </thead>
168       <tbody>
169         % for rg in recent_games:
170         <tr>
171           <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>
172           <td class="tdcenter"><span class="sprite sprite-${rg.game_type_cd}" alt="${rg.game_type_cd}" title="${rg.game_type_descr}"></span></td>
173           <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>
174           <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>
175           <td>
176             % if rg.player_id > 2:
177             <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>
178             % else:
179             ${rg.nick_html_colors|n}
180             % endif
181           </td>
182         </tr>
183         % endfor
184       </tbody>
185     </table>
186     <p><a href="${request.route_url('game_finder', _query={'map_id':gmap.map_id})}">More...</a></p>
187   </div>
188 </div>
189 % endif
190
191
192 % endif