]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/map_info.mako
Add a link to view the fastest capture times on the map_info page.
[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 % if gmap is None:
18   <h2>Sorry, that map wasn't found!</h2>
19
20 % else:
21   <h2>${gmap.name}</h2>
22   <p>
23     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>
24   </p>
25
26   <div class="row">
27     <div class="small-12 large-4 columns">
28       <h5>Top Scoring Players</h5>
29       <table class="table-hover table-condensed">
30         <thead>
31           <tr>
32             <th class="small-2">#</th>
33             <th class="small-7">Nick</th>
34             <th class="small-4">Score</th>
35           </tr>
36         </thead>
37         <tbody>
38           <% i = 1 %>
39           % for (score_player_id, score_nick, score_value) in top_scorers:
40             <tr>
41               <td>${i}</td>
42               % if score_player_id != '-':
43                 <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>
44               % else:
45                 <td class="no-stretch">${score_nick}</td>
46               % endif
47               <td>${score_value}</td>
48             </tr>
49             <% i = i+1 %>
50           % endfor
51           </tbody>
52       </table>
53     </div>
54
55     <div class="small-12 large-4 columns">
56       <h5>Most Active Players</h5>
57       <table class="table-hover table-condensed">
58         <thead>
59           <tr>
60             <th class="small-2">#</th>
61             <th class="small-7">Nick</th>
62             <th class="small-4">Time</th>
63           </tr>
64         </thead>
65         <tbody>
66         <% i = 1 %>
67         % for (player_id, nick, alivetime) in top_players:
68           <tr>
69             <td>${i}</td>
70             % if player_id != '-':
71             <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>
72             % else:
73             <td class="no-stretch">${nick}</td>
74             % endif
75             <td>${alivetime}</td>
76           </tr>
77           <% i = i+1 %>
78         % endfor
79         </tbody>
80       </table>
81     </div>
82
83     <div class="small-12 large-4 columns">
84       <h5>Most Active Servers</h5>
85       <table class="table-hover table-condensed">
86         <thead>
87           <tr>
88             <th class="small-2">#</th>
89             <th class="small-7">Name</th>
90             <th class="small-4"># Games</th>
91           </tr>
92         </thead>
93         <tbody>
94         <% i = 1 %>
95         % for (server_id, name, times_played) in top_servers:
96           <tr>
97             <td>${i}</td>
98             <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>
99             <td>${times_played}</td>
100           </tr>
101           <% i = i+1 %>
102         % endfor
103         </tbody>
104       </table>
105     </div>
106   </div> <!-- /row -->
107
108   <div class="row">
109     <div class="small-12 columns">
110       <small>*Most active stats are from the past 7 days</small>
111     </div>
112   </div>
113
114   % if len(captimes) > 0:
115   <div class="row">
116     <div class="small-12 large-6 columns">
117       <h5>Best Flag Capture Times <a href="${request.route_url('map_captimes', id=gmap.map_id)}" title="See more flag capture times for ${gmap.name}"><i class="fa fa-plus-circle"></i></a></h5>
118       <table class="table-hover table-condensed">
119         <thead>
120           <tr>
121              <th class="small-8">Nick</th>
122              <th class="small-4">Captime</th>
123           </tr>
124         </thead>
125         <tbody>
126         % for c in captimes:
127           <tr>
128             <td class="no-stretch">
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>${c.nick_html_colors|n}</span>
133               </a>
134             % else:
135               <span>${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   % if len(recent_games) > 0:
153   <div class="row">
154     <div class="small-12 columns">
155       <h5>Most Recent Games</h5>
156       <table class="table-hover table-condensed">
157         <thead>
158           <tr>
159             <th class="small-1 text-center"></th>
160             <th class="small-1">Type</th>
161             <th class="show-for-medium-up small-3">Server</th>
162             <th class="show-for-large-up small-3">Time</th>
163             <th class="small-3">Winner</th>
164           </tr>
165         </thead>
166         <tbody>
167           % for rg in recent_games:
168           <tr>
169             <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>
170             <td class="text-center"><span class="sprite sprite-${rg.game_type_cd}" alt="${rg.game_type_cd}" title="${rg.game_type_descr}"></span></td>
171             <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>
172             <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>
173             <td class="no-stretch">
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       <p><a href="${request.route_url('game_index', _query={'map_id':gmap.map_id})}">More...</a></p>
185     </div>
186   </div>
187   % endif
188
189 % endif