Remove Persona since it was shut down. :(
[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 
15     % if game_type_descr:
16       ${game_type_descr.lower()}
17     % endif
18     games yet for 
19     <a href="${request.route_url('player_info', id=player.player_id)}">${player.nick_html_colors()|n}</a>. Get playing!
20   </h2>
21
22   <p><a href="${player_url}">Back to player info page</a></p>
23
24 % else:
25   <div class="row">
26     <div class="small-12 columns">
27       <h5>Recent 
28         % if game_type_descr:
29         ${game_type_descr}
30         % endif
31         Games by 
32         <a href="${request.route_url('player_info', id=player.player_id)}">
33           ${player.nick_html_colors()|n}
34         </a>
35       </h5>
36     </div>
37   </div>
38
39   <div class="row">
40     <div class="small-12 columns">
41       <ul class="tabs">
42         % for game in games_played:
43           % if not game.game_type_cd in ['cq']:
44             <li class="text-center tab-title
45               % if game.game_type_cd == game_type_cd or (game.game_type_cd == 'overall' and game_type_cd is None):
46                 active
47               % endif
48               "
49             >
50               % if game.game_type_cd == 'overall':
51                 <a href="${request.route_url("player_game_index", player_id=player.player_id)}" alt="${game.game_type_cd}" title="" data-toggle="none">
52               % else:
53                 <a href="${request.route_url("player_game_index", player_id=player.player_id, _query={'type':game.game_type_cd})}" alt="${game.game_type_cd}" title="" data-toggle="none">
54               % endif
55               <span class="sprite sprite-${game.game_type_cd}"></span><br />
56               ${game.game_type_cd} <br />
57               </a>
58             </li>
59           % endif
60         % endfor
61       </ul>
62       <br />
63     </div>
64   </div>
65
66   <div class="row">
67     <div class="small-12 columns">
68       <table class="table-hover table-condensed">
69         <thead>
70           <tr>
71             <th class="small-1 text-center"></th>
72             <th class="small-1">Type</th>
73             <th class="show-for-medium-up small-3">Server</th>
74             <th class="small-2">Map</th>
75             <th class="show-for-medium-up small-1">Result</th>
76             <th class="show-for-medium-up small-2">Played</th>
77             <th class="small-1">Elo</th>
78           </tr>
79         </thead>
80         <tbody>
81         % for rg in games.items:
82         <tr>
83           <td class="text-center"><a class="button tiny" href="${request.route_url('game_info', id=rg.game_id)}" title="View detailed information about this game">view</a></td>
84           <td class="text-center"><span class="sprite sprite-${rg.game_type_cd}"></span></td>
85           <td class="show-for-medium-up no-stretch"><a href="${request.route_url("server_info", id=rg.server_id)}" name="Server info page for ${rg.server_name}">${rg.server_name}</a></td>
86           <td class="no-stretch"><a href="${request.route_url("map_info", id=rg.map_id)}" name="Map info page for ${rg.map_name}">${rg.map_name}</a></td>
87           <td class="show-for-medium-up">
88             % if rg.team != None:
89               % if rg.team == rg.winner:
90                 Win
91               % else:
92                 Loss
93               % endif
94             % else:
95               % if rg.rank == 1:
96                 Win
97               % else:
98                 Loss (#${rg.rank})
99               % endif
100             % endif
101           </td>
102           <td class="show-for-medium-up"><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>
103           <td class="text-center">
104             <a href="${request.route_url('game_info', id=rg.game_id, _query={'show_elo':1})}" title="View detailed information about this game">
105               % if rg.elo_delta is not None:
106                 % if round(rg.elo_delta,2) > 0:
107                   <span class="eloup">+${round(rg.elo_delta,2)}</span>
108                 % elif round(rg.elo_delta,2) < 0:
109                   <span class="elodown">${round(rg.elo_delta,2)}</span>
110                 % else:
111                   <span class="eloneutral"><i class="fa fa-minus"></i></span>
112                 % endif
113               % else:
114                 <span class="eloneutral"><i class="fa fa-minus"></i></span>
115               % endif
116             </a>
117           </td>
118         </tr>
119         % endfor
120         </tbody>
121       </table>
122     </div>
123   </div>
124
125
126   <!-- navigation links -->
127   ${navlinks("player_game_index", games.page, games.last_page, player_id=player_id, search_query=request.GET)}
128 % endif