]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/map_captimes.mako
Add pagination to player_captimes & map_captimes; convert SQL queries to SQLalchemy
[xonotic/xonstat.git] / xonstat / templates / map_captimes.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 Map captimes
11 </%block>
12
13 % if len(captimes) == 0:
14 <h2>Sorry, no caps yet. Get playing!</h2>
15 <p><a href="${map_url}">Back to map info page</a></p>
16 % else:
17
18 <div class="row">
19   <div class="span12">
20
21     <h2>${map.name}</h2>
22     <p><a href="${request.route_url('map_info', id=map.map_id)}">Back to map info page</a></p>
23
24     <h3>Fastest Flag Captures:</h3>
25
26     <table class="table table-bordered table-condensed">
27       <thead>
28         <tr>
29            <th>Game</th>
30            <th>Captime</th>
31            <th>Nick</th>
32            <th>Server</th>
33            <th>Date</th>
34         </tr>
35       </thead>
36       <tbody>
37       % for ct in captimes.items:
38         <tr>
39           <td class="tdcenter"><a class="btn btn-primary btn-small" href="${request.route_url('game_info', id=ct.game_id)}" title="View detailed information about this game">view</a></td>
40           <td>${ct.fastest_cap.total_seconds()} seconds</td>
41           <td class="player-nick">
42             % if ct.player_id > 2:
43             <a href="${request.route_url('player_info', id=ct.player_id)}" title="Go to the player info page for this player">${ct.player_nick_html|n}</a>
44             % else:
45             ${rg.nick_html_colors|n}
46             % endif
47           </td>
48           <td><a href="${request.route_url('server_info', id=ct.server_id)}" title="Go to the detail page for this server">${ct.server_name}</a></td>
49           <td><span class="abstime" data-epoch="${ct.create_dt_epoch}" title="${ct.create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${ct.create_dt_fuzzy}</span></td>
50       % endfor
51       </tbody>
52     </table>
53
54   </div>
55 </div>
56
57 <!-- navigation links -->
58 ${navlinks("map_captimes", captimes.page, captimes.last_page, id=map_id, search_query=request.GET)}
59 % endif