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