Highlight the filtered game mode.
[xonotic/xonstat.git] / xonstat / templates / game_index.mako
1 <%inherit file="base.mako"/>
2 <%namespace name="nav" file="nav.mako" />
3 <%namespace file="scoreboard.mako" import="scoreboard" />
4 <%namespace file="navlinks.mako" import="navlinks" />
5
6 <%block name="css">
7 ${parent.css()}
8 <link href="/static/css/sprites.css" rel="stylesheet">
9 </%block>
10
11 <%block name="navigation">
12 ${nav.nav('games')}
13 </%block>
14
15 <%block name="title">
16 Game Index
17 </%block>
18
19 % if not games:
20 <h2>Sorry, no 
21   % if game_type_descr:
22   ${game_type_descr.lower()}
23   % endif
24   games yet. Get playing!</h2>
25
26 % else:
27 <div class="row">
28   <div class="span12">
29     <h2>Recent 
30     % if game_type_descr:
31     ${game_type_descr}
32     % endif
33       Games</h2>
34   </div>
35 </div>
36 <div class="row">
37   <div class="span12 tabbable">
38     <ul class="nav nav-tabs">
39       % for gt in ('overall','duel','ctf','dm','tdm','ca','kh','ft','lms','as','dom','nb','cts','rc'):
40       ##% for gt in ('overall','duel','ctf','dm','tdm','ca','kh','ft','lms','as','dom','nb','cts','rc'):
41       <li>
42       % if gt == 'overall':
43       <a href="${request.route_url("game_index")}" alt="${gt}" title="" data-toggle="none">
44       % else:
45       <a href="${request.route_url("game_index", _query={'game_type_cd':gt})}" alt="${gt}" title="" data-toggle="none">
46       % endif
47         <span class="sprite sprite-${gt}"> </span><br />
48         ${gt} <br />
49       </a>
50       </li>
51       % endfor
52     </ul>
53   </div>
54   <div class="span12 offset1 tab-content">
55     % for rg in games.items:
56     <div class="game">
57       <img src="/static/images/icons/48x48/${rg.game_type_cd}.png" width="30" height="30" alt="${rg.game_type_cd}" title="${rg.game_type_descr}"/>
58       <h4><a href="${request.route_url("map_info", id=rg.map_id)}" name="Map info page for ${rg.map_name}">${rg.map_name}</a> on <a href="${request.route_url("server_info", id=rg.server_id)}" name="Server info page for ${rg.server_name}">${rg.server_name}</a> <span class="permalink">(<a href="${request.route_url('game_info', id=rg.game_id)}" name="Permalink for game #${rg.game_id}">permalink</a>)</span></h4>
59       <span class="clear"></span>
60       ${scoreboard(rg.game_type_cd, pgstats[rg.game_id])}
61     </div>
62     % endfor
63   </div>
64 </div>
65
66 <div class="row">
67   <div class="span10 offset1">
68     <!-- navigation links -->
69     ${navlinks("game_index", games.page, games.last_page, search_query=request.GET)}
70   </div>
71 </div>
72 % endif
73