]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/player_game_index.mako
9b60e3cba4034d1d34099e03d40c3fc9c9b91471
[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-bordered 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 g in games.items:
38         <tr>
39            <td class="tdcenter"><a class="btn btn-primary btn-small" href="${request.route_url('game_info', id=g.game_id)}" title="View detailed information about this game">view</a></td>
40            <td class="tdcenter"><img title="${g.game_type_cd}" src="/static/images/icons/24x24/${g.game_type_cd}.png" alt="${g.game_type_cd}" /></td>
41            <td>${g.server_name}</td>
42            <td>${g.map_name}</td>
43            <td>
44            % if g.team != None:
45              % if g.team == g.winner:
46              Win
47              % else:
48              Loss
49              % endif
50           % else:
51             % if g.rank == 1:
52             Win
53             % else:
54             Loss (#${g.rank})
55             % endif
56           % endif
57            </td>
58            <td><span class="abstime" data-epoch="${g.game_epoch}" title="${g.game_create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${g.game_fuzzy}</span></td>
59            <td class="tdcenter">
60              % if g.elo_delta is not None:
61                % if round(g.elo_delta,2) > 0:
62                <span title="Elo went up by ${round(g.elo_delta,2)}"><i class="icon-arrow-up icon-white"></i></span>
63                % elif round(g.elo_delta,2) < 0:
64                <span title="Elo went down by ${round(g.elo_delta,2)}"><i class="icon-arrow-down icon-white"></i></span>
65                % else:
66                <span title="Elo did not change"><i class="icon-minus icon-white"></i></span>
67                % endif
68              % else:
69                <span title="Elo did not change"><i class="icon-minus icon-white"></i></span>
70              % endif
71            </td>
72         </tr>
73       % endfor
74       </tbody>
75     </table>
76   </div>
77 </div>
78
79 <!-- navigation links -->
80 ${navlinks("player_game_index", games.page, games.last_page, player_id=player_id)}
81 % endif