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