]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/player_game_index.mako
Adding "back" links to some player-info pages
[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="navigation">
6 ${nav.nav('games')}
7 </%block>
8
9 <%block name="title">
10 Recent Games
11 </%block>
12
13 % if not games:
14 <h2>Sorry, no games yet. Get playing!</h2>
15 <p><a href="${player_url}">Back to player info page</a></p>
16
17 % else:
18 <div class="row">
19   <div class="span12">
20     <h3>Recent Games by ${player.nick_html_colors()|n}</h3>
21     <p><a href="${player_url}">Back to player info page</a></p>
22   </div>
23 </div>
24 <div class="row">
25   <div class="span12">
26     <table class="table table-hover table-condensed">
27       <thead>
28         <tr>
29           <th></th>
30           <th>Type</th>
31           <th>Server</th>
32           <th>Map</th>
33           <th>Result</th>
34           <th>Played</th>
35           <th>Elo</th>
36         </tr>
37       </thead>
38       <tbody>
39       % for rg in games.items:
40       <tr>
41         <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>
42         <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>
43         <td>${rg.server_name}</td>
44         <td>${rg.map_name}</td>
45         <td>
46           % if rg.team != None:
47           % if rg.team == rg.winner:
48           Win
49           % else:
50           Loss
51           % endif
52           % else:
53           % if rg.rank == 1:
54           Win
55           % else:
56           Loss (#${rg.rank})
57           % endif
58           % endif
59         </td>
60         <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>
61         <td class="tdcenter">
62           <a href="${request.route_url('game_info', id=rg.game_id, _query={'show_elo':1})}" title="View detailed information about this game">
63             % if rg.elo_delta is not None:
64             % if round(rg.elo_delta,2) > 0:
65             <span title="Elo went up by ${round(rg.elo_delta,2)}"><i class="glyphicon glyphicon-arrow-up"></i></span>
66             % elif round(rg.elo_delta,2) < 0:
67             <span title="Elo went down by ${round(-rg.elo_delta,2)}"><i class="glyphicon glyphicon-arrow-down"></i></span>
68             % else:
69             <span title="Elo did not change"><i class="glyphicon glyphicon-minus"></i></span>
70             % endif
71             % else:
72             <span title="Elo did not change"><i class="glyphicon glyphicon-minus"></i></span>
73             % endif
74           </a>
75         </td>
76       </tr>
77       % endfor
78       </tbody>
79     </table>
80   </div>
81 </div>
82
83 <!-- navigation links -->
84 ${navlinks("player_game_index", games.page, games.last_page, player_id=player_id)}
85 % endif