c2fd6cee737020434f2b1d9b93f00b69636d8646
[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   % if not game_type_cd:
20 <h2>Sorry, no games yet. Get playing!</h2>
21   % else:
22 <h2>Sorry, no ${game_type_cd.upper()} games yet. Get playing!</h2>
23   % endif
24 <p><a href="${player_url}">Back to player info page</a></p>
25
26 % else:
27 <div class="row">
28   <div class="span12">
29     % if not game_type_cd:
30     <h3>Recent Games by ${player.nick_html_colors()|n}</h3>
31     % else:
32     <h3>Recent ${game_type_cd.upper()} Games by ${player.nick_html_colors()|n}</h3>
33     % endif
34     <p><a href="${player_url}">Back to player info page</a></p>
35   </div>
36 </div>
37 <br/>
38 <div class="row">
39   <div class="span12 tabbable">
40     <ul class="nav nav-tabs">
41       % for game in games_played:
42       <li>
43       % if game.game_type_cd == 'overall':
44       <a href="${request.route_url("player_game_index", player_id=player.player_id)}" alt="${game.game_type_cd}" title="" data-toggle="none">
45       % else:
46       <a href="${request.route_url("player_game_index_filtered", player_id=player.player_id, game_type_cd=game.game_type_cd)}" alt="${game.game_type_cd}" title="" data-toggle="none">
47       % endif
48         <span class="sprite sprite-${game.game_type_cd}"> </span><br />
49         ${game.game_type_cd} <br />
50       </a>
51       </li>
52       % endfor
53     </ul>
54   </div>
55   <div class="span12 tab-content" style="margin-top:10px;">
56     <table class="table table-hover table-condensed">
57       <thead>
58         <tr>
59           <th></th>
60           <th>Type</th>
61           <th>Server</th>
62           <th>Map</th>
63           <th>Result</th>
64           <th>Played</th>
65           <th>Elo</th>
66         </tr>
67       </thead>
68       <tbody>
69       % for rg in games.items:
70       <tr>
71         <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>
72         <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>
73         <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>
74         <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>
75         <td>
76           % if rg.team != None:
77           % if rg.team == rg.winner:
78           Win
79           % else:
80           Loss
81           % endif
82           % else:
83           % if rg.rank == 1:
84           Win
85           % else:
86           Loss (#${rg.rank})
87           % endif
88           % endif
89         </td>
90         <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>
91         <td class="tdcenter">
92           <a href="${request.route_url('game_info', id=rg.game_id, _query={'show_elo':1})}" title="View detailed information about this game">
93             % if rg.elo_delta is not None:
94             % if round(rg.elo_delta,2) > 0:
95             <span title="Elo went up by ${round(rg.elo_delta,2)}"><i class="glyphicon glyphicon-arrow-up"></i></span>
96             % elif round(rg.elo_delta,2) < 0:
97             <span title="Elo went down by ${round(-rg.elo_delta,2)}"><i class="glyphicon glyphicon-arrow-down"></i></span>
98             % else:
99             <span title="Elo did not change"><i class="glyphicon glyphicon-minus"></i></span>
100             % endif
101             % else:
102             <span title="Elo did not change"><i class="glyphicon glyphicon-minus"></i></span>
103             % endif
104           </a>
105         </td>
106       </tr>
107       % endfor
108       </tbody>
109     </table>
110   </div>
111 </div>
112
113
114 <!-- navigation links -->
115 ${navlinks("player_game_index", games.page, games.last_page, player_id=player_id)}
116 % endif