]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/game_finder.mako
Replace the game_index view w/ game_finder.
[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 % if len(recent_games) > 0:
19
20 ##### ROW OF GAME TYPE ICONS #####
21 <div class="row">
22   <div class="span12 tabbable">
23     <ul class="nav nav-tabs">
24       % for gt in ('overall','duel','ctf','dm','tdm','ca','kh','ft','lms','as','dom','nb','cts','rc'):
25       <li 
26       % if game_type_cd == gt or (game_type_cd is None and gt == 'overall'):
27       class="active"
28       % endif
29       >
30
31       % if gt == 'overall':
32       <a href="${request.route_url("game_index")}" alt="${gt}" title="" data-toggle="none">
33       % else:
34       <a href="${request.route_url("game_index", _query={'type':gt})}" alt="${gt}" title="" data-toggle="none">
35       % endif
36         <span class="sprite sprite-${gt}"> </span><br />
37         ${gt} <br />
38       </a>
39       </li>
40       % endfor
41     </ul>
42     <br />
43   </div>
44 </div>
45
46 ##### RECENT GAMES TABLE #####
47 <div class="row">
48   <div class="span12">
49     <table class="table table-hover table-condensed">
50       <thead>
51         <tr>
52           <th></th>
53           <th>Type</th>
54           <th>Server</th>
55           <th>Map</th>
56           <th>Time</th>
57           <th>Winner</th>
58         </tr>
59       </thead>
60       <tbody>
61       % for rg in recent_games.items:
62         <tr>
63           <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>
64           <td class="tdcenter"><span alt="${rg.game_type_cd}" class="sprite sprite-${rg.game_type_cd}" title="${rg.game_type_descr}"></span></td>
65           <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>
66           <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>
67           <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>
68           <td>
69             % if rg.player_id > 2:
70             <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>
71             % else:
72             ${rg.nick_html_colors|n}</td>
73             % endif
74         </tr>
75         % endfor
76         </tbody>
77     </table>
78   </div> <!-- /span12 -->
79 </div> <!-- /row -->
80
81 <!-- navigation links -->
82 ${navlinks("game_index", recent_games.page, recent_games.last_page, search_query=query)}
83 % endif