Fix up layout of gametype filters in game_index
[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   % if not game_type_cd:
21 <h2>Sorry, no games yet. Get playing!</h2>
22   % else:
23 <h2>Sorry, no ${game_type_cd.upper()} games yet. Get playing!</h2>
24   % endif
25
26 % else:
27 <div class="row">
28   <div class="span12">
29     % if not game_type_cd:
30     <h2>Recent Games</h2>
31     % else:
32     <h2>Recent ${game_type_cd.upper()} Games</h2>
33     % endif
34   </div>
35 </div>
36 <div class="row">
37   <div class="span12 btn-toolbar">
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       % for gt in ('overall','duel','ctf','dm','tdm'):
42       <li>
43       % if gt == 'overall':
44       <a href="${request.route_url("game_index")}" alt="${gt}" title="" data-toggle="none">
45       % else:
46       <a href="${request.route_url("game_index_filtered", game_type_cd=gt)}" alt="${gt}" title="" data-toggle="none">
47       % endif
48         <span class="sprite sprite-${gt}"> </span><br />
49         ${gt} <br />
50       </a>
51       </li>
52       % endfor
53       <li>
54         <div class="btn-group nav">
55           <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
56             <span class="caret"> </span><br/>
57             more...
58           </a>
59           <ul class="dropdown-menu nav-tabs">
60             % for gt in ('ca','kh','ft','lms','as','dom','nb','cts','rc'):
61             <li>
62             <a href="${request.route_url("game_index_filtered", game_type_cd=gt)}" alt="${gt}" title="" data-toggle="none">
63               <span class="sprite sprite-${gt}"> </span><br/>
64               ${gt}
65             </a>
66             </li>
67             % endfor
68           </ul>
69         </div>
70       </li>
71     </ul>
72   </div>
73   <div class="span12 offset1 tab-content">
74     % for rg in games.items:
75     <div class="game">
76       <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}"/>
77       <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>
78       <span class="clear"></span>
79       ${scoreboard(rg.game_type_cd, pgstats[rg.game_id])}
80     </div>
81     % endfor
82   </div>
83 </div>
84
85 <div class="row">
86   <div class="span10 offset1">
87     <!-- navigation links -->
88     ${navlinks("game_index", games.page, games.last_page)}
89   </div>
90 </div>
91 % endif
92