]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/game_finder.mako
Paginate differently on the game_finder page.
[xonotic/xonstat.git] / xonstat / templates / game_finder.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('games')}
7 </%block>
8
9 <%block name="css">
10     ${parent.css()}
11     <link href="/static/css/sprites.css" rel="stylesheet">
12 </%block>
13
14 <%block name="title">
15 Game Index
16 </%block>
17
18 ##### ROW OF GAME TYPE ICONS #####
19 <div class="row">
20   <div class="span12 tabbable">
21     <ul class="nav nav-tabs">
22       % for gt, url in game_type_links:
23       <li
24         % if game_type_cd == gt or (game_type_cd is None and gt == 'overall'):
25         class="active"
26         % endif
27       >
28         <a href="${url}" alt="${gt}" title="Show only ${gt} games" data-toggle="none">
29           <span class="sprite sprite-${gt}"> </span><br />
30           ${gt} <br />
31         </a>
32       </li>
33       % endfor
34     </ul>
35     <br />
36   </div>
37 </div>
38
39 ##### RECENT GAMES TABLE #####
40 <div class="row">
41   <div class="span12">
42     % if len(recent_games) > 0:
43     <table class="table table-hover table-condensed">
44       <thead>
45         <tr>
46           <th></th>
47           <th>Type</th>
48           <th>Server</th>
49           <th>Map</th>
50           <th>Time</th>
51           <th>Winner</th>
52         </tr>
53       </thead>
54       <tbody>
55       % for rg in recent_games:
56         <tr>
57           <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>
58           <td class="tdcenter"><span alt="${rg.game_type_cd}" class="sprite sprite-${rg.game_type_cd}" title="${rg.game_type_descr}"></span></td>
59           <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>
60           <td><a href="${request.route_url('map_info', id=rg.map_id)}" title="Go to the map detail page for this map">${rg.map_name}</a></td>
61           <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>
62           <td>
63             % if rg.player_id > 2:
64             <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></td>
65             % else:
66             ${rg.nick_html_colors|n}</td>
67             % endif
68         </tr>
69         % endfor
70         </tbody>
71     </table>
72     % else:
73     <h2>No more games to show!</h2>
74     % endif
75   </div> <!-- /span12 -->
76 </div> <!-- /row -->
77
78 % if len(recent_games) == 20:
79 <div class="row">
80   <div class="span12 text-center">
81     <ul class="pagination">
82       <li>
83         <a  href="${request.route_url('game_index', _query=query)}" name="Next Page">Next <i class="glyphicon glyphicon-arrow-right"></i></a>
84       </li>
85     </ul>
86   </div>
87 </div>
88 % endif