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