Filter cq gametype from player_game_index
[xonotic/xonstat.git] / xonstat / templates / player_game_index.mako
1 <%inherit file="base.mako"/>
2 <%namespace name="nav" file="nav.mako" />
3 <%namespace file="navlinks.mako" import="navlinks" />
4
5 <%block name="css">
6 ${parent.css()}
7 <link href="/static/css/sprites.css" rel="stylesheet">
8 </%block>
9
10 <%block name="navigation">
11 ${nav.nav('games')}
12 </%block>
13
14 <%block name="title">
15 Recent Games
16 </%block>
17
18 % if not games:
19 <h2>Sorry, no 
20     % if game_type_descr:
21     ${game_type_descr.lower()}
22     % endif
23   games yet for 
24   <a href="${request.route_url('player_info', id=player.player_id)}">${player.nick_html_colors()|n}</a>. Get playing!
25 </h2>
26 <p><a href="${player_url}">Back to player info page</a></p>
27
28 % else:
29 <div class="row">
30   <div class="span12">
31     <h3>Recent 
32       % if game_type_descr:
33       ${game_type_descr}
34       % endif
35       Games by 
36       <a href="${request.route_url('player_info', id=player.player_id)}">
37         ${player.nick_html_colors()|n}
38       </a>
39     </h3>
40   </div>
41 </div>
42
43 <div class="row">
44   <div class="span12 tabbable">
45     <ul class="nav nav-tabs">
46       % for game in games_played:
47       % if not game.game_type_cd in ['cq']:
48       <li>
49       % if game.game_type_cd == 'overall':
50       <a href="${request.route_url("player_game_index", player_id=player.player_id)}" alt="${game.game_type_cd}" title="" data-toggle="none">
51       % else:
52       <a href="${request.route_url("player_game_index", player_id=player.player_id, _query={'game_type_cd':game.game_type_cd})}" alt="${game.game_type_cd}" title="" data-toggle="none">
53       % endif
54         <span class="sprite sprite-${game.game_type_cd}"> </span><br />
55         ${game.game_type_cd} <br />
56       </a>
57       </li>
58       % endif
59       % endfor
60     </ul>
61   </div>
62   <div class="span12 tab-content" style="margin-top:10px;">
63     <table class="table table-hover table-condensed">
64       <thead>
65         <tr>
66           <th></th>
67           <th>Type</th>
68           <th>Server</th>
69           <th>Map</th>
70           <th>Result</th>
71           <th>Played</th>
72           <th>Elo</th>
73         </tr>
74       </thead>
75       <tbody>
76       % for rg in games.items:
77       <tr>
78         <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>
79         <td class="tdcenter"><img title="${rg.game_type_cd}" src="/static/images/icons/24x24/${rg.game_type_cd}.png" alt="${rg.game_type_cd}" /></td>
80         <td><a href="${request.route_url("server_info", id=rg.server_id)}" name="Server info page for ${rg.server_name}">${rg.server_name}</a></td>
81         <td><a href="${request.route_url("map_info", id=rg.map_id)}" name="Map info page for ${rg.map_name}">${rg.map_name}</a></td>
82         <td>
83           % if rg.team != None:
84           % if rg.team == rg.winner:
85           Win
86           % else:
87           Loss
88           % endif
89           % else:
90           % if rg.rank == 1:
91           Win
92           % else:
93           Loss (#${rg.rank})
94           % endif
95           % endif
96         </td>
97         <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>
98         <td class="tdcenter">
99           <a href="${request.route_url('game_info', id=rg.game_id, _query={'show_elo':1})}" title="View detailed information about this game">
100             % if rg.elo_delta is not None:
101             % if round(rg.elo_delta,2) > 0:
102             <span class="eloup" title="Elo went up by ${round(rg.elo_delta,2)}"><i class="glyphicon glyphicon-arrow-up"></i></span>
103             % elif round(rg.elo_delta,2) < 0:
104             <span class="elodown" title="Elo went down by ${round(-rg.elo_delta,2)}"><i class="glyphicon glyphicon-arrow-down"></i></span>
105             % else:
106             <span class="eloneutral" title="Elo did not change"><i class="glyphicon glyphicon-minus"></i></span>
107             % endif
108             % else:
109             <span class="eloneutral" title="Elo did not change"><i class="glyphicon glyphicon-minus"></i></span>
110             % endif
111           </a>
112         </td>
113       </tr>
114       % endfor
115       </tbody>
116     </table>
117   </div>
118 </div>
119
120
121 <!-- navigation links -->
122 ${navlinks("player_game_index", games.page, games.last_page, player_id=player_id, search_query=request.GET)}
123 % endif