]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/player_captimes.mako
Prevent 500s when the player has no caps.
[xonotic/xonstat.git] / xonstat / templates / player_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('players')}
7 </%block>
8
9 <%block name="title">
10 Player captimes
11 </%block>
12
13 % if len(captimes) == 0:
14 <h2>Sorry, no caps yet. Get playing!</h2>
15 <p><a href="${request.route_url('player_info', id=player.player_id)}">Back to player info page</a></p>
16 % else:
17
18 <div class="row">
19   <div class="span12">
20     <h3>Fastest Flag Captures by
21       <a href="${request.route_url('player_info', id=player.player_id)}">
22         ${player.nick_html_colors()|n}
23       </a>
24     </h3>
25  
26     <table class="table table-hover table-condensed">
27       <thead>
28         <tr>
29            <th>Game</th>
30            <th>Captime</th>
31            <th>Map</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><a href="${request.route_url('map_info', id=ct.map_id)}" title="Go to the detail page for this map">${ct.map_name}</a></td>
42           <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>
43           <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>
44       % endfor
45       </tbody>
46     </table>
47
48   </div>
49 </div>
50
51 <!-- navigation links -->
52 ${navlinks("player_captimes", captimes.page, captimes.last_page, player_id=player_id, search_query=request.GET)}
53 % endif