]> git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/map_info.mako
Use Luma throughout the site. Thank you, sev!
[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/luma.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
31   <div class="row">
32     <div class="small-12 large-4 columns">
33       <h5>Top Scoring Players</h5>
34       <table class="table-hover table-condensed">
35         <thead>
36           <tr>
37             <th class="small-2">#</th>
38             <th class="small-7">Nick</th>
39             <th class="small-4">Score</th>
40           </tr>
41         </thead>
42         <tbody>
43           <% i = 1 %>
44           % for (score_player_id, score_nick, score_value) in top_scorers:
45             <tr>
46               <td>${i}</td>
47               % if score_player_id != '-':
48                 <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>
49               % else:
50                 <td class="no-stretch">${score_nick}</td>
51               % endif
52               <td>${score_value}</td>
53             </tr>
54             <% i = i+1 %>
55           % endfor
56           </tbody>
57       </table>
58     </div>
59
60     <div class="small-12 large-4 columns">
61       <h5>Most Active Players</h5>
62       <table class="table-hover table-condensed">
63         <thead>
64           <tr>
65             <th class="small-2">#</th>
66             <th class="small-7">Nick</th>
67             <th class="small-4">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 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>
77             % else:
78             <td class="no-stretch">${nick}</td>
79             % endif
80             <td>${alivetime}</td>
81           </tr>
82           <% i = i+1 %>
83         % endfor
84         </tbody>
85       </table>
86     </div>
87
88     <div class="small-12 large-4 columns">
89       <h5>Most Active Servers</h5>
90       <table class="table-hover table-condensed">
91         <thead>
92           <tr>
93             <th class="small-2">#</th>
94             <th class="small-7">Name</th>
95             <th class="small-4"># Games</th>
96           </tr>
97         </thead>
98         <tbody>
99         <% i = 1 %>
100         % for (server_id, name, times_played) in top_servers:
101           <tr>
102             <td>${i}</td>
103             <td class="no-stretch" style="max-width:150px;"><a href="${request.route_url('server_info', id=server_id)}" title="Go to the server info page for this server">${name}</a></td>
104             <td>${times_played}</td>
105           </tr>
106           <% i = i+1 %>
107         % endfor
108         </tbody>
109       </table>
110     </div>
111   </div> <!-- /row -->
112
113   <div class="row">
114     <div class="small-12 columns">
115       <small>*Most active stats are from the past 7 days</small>
116     </div>
117   </div>
118
119   % if len(captimes) > 0:
120   <div class="row">
121     <div class="small-12 large-6 columns">
122       <h5>Best Flag Capture Times</h5>
123       <table class="table-hover table-condensed">
124         <thead>
125           <tr>
126              <th class="small-8">Nick</th>
127              <th class="small-4">Captime</th>
128           </tr>
129         </thead>
130         <tbody>
131         % for c in captimes:
132           <tr>
133             <td class="no-stretch">
134             % if c.player_id > 2:
135               <a href="${request.route_url("player_info", id=c.player_id)}"
136                title="Go to the info page for this player">
137               <span>${c.nick_html_colors|n}</span>
138               </a>
139             % else:
140               <span>${c.nick_html_colors|n}</span>
141             % endif
142             </td>
143             <td>
144               <a href="${request.route_url("game_info", id=c.game_id)}"
145                title="View the game in which this cap was made">
146                 ${round(float(c.fastest_cap.seconds) + (c.fastest_cap.microseconds/1000000.0), 2)}
147               </a>
148             </td>
149           </tr>
150         % endfor
151         </tbody>
152       </table>
153     </div>
154   </div>
155   % endif
156
157   % if len(recent_games) > 0:
158   <div class="row">
159     <div class="small-12 columns">
160       <h5>Most Recent Games</h5>
161       <table class="table-hover table-condensed">
162         <thead>
163           <tr>
164             <th class="small-1 text-center"></th>
165             <th class="small-1">Type</th>
166             <th class="show-for-medium-up small-3">Server</th>
167             <th class="show-for-large-up small-3">Time</th>
168             <th class="small-3">Winner</th>
169           </tr>
170         </thead>
171         <tbody>
172           % for rg in recent_games:
173           <tr>
174             <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>
175             <td class="text-center"><span class="sprite sprite-${rg.game_type_cd}" alt="${rg.game_type_cd}" title="${rg.game_type_descr}"></span></td>
176             <td class="show-for-medium-up"><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>
177             <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>
178             <td class="no-stretch">
179               % if rg.player_id > 2:
180               <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>
181               % else:
182               ${rg.nick_html_colors|n}
183               % endif
184             </td>
185           </tr>
186           % endfor
187         </tbody>
188       </table>
189       <p><a href="${request.route_url('game_index', _query={'map_id':gmap.map_id})}">More...</a></p>
190     </div>
191   </div>
192   % endif
193
194 % endif