]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/map_info.mako
Use the new helpers on the map info page.
[xonotic/xonstat.git] / xonstat / templates / map_info.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('maps')}
7 </%block>
8
9 <%block name="title">
10 % if gmap:
11 Map Information
12 % endif
13
14 ${parent.title()}
15 </%block>
16
17
18 % if gmap is None:
19 <h2>Sorry, that map wasn't found!</h2>
20
21 % else:
22 <h2>${gmap.name}</h2>
23 <p>
24   Added <span class="abstime" data-epoch="${gmap.epoch()}" title="${gmap.create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${gmap.fuzzy_date()}</span>
25 </p>
26 <div class="row">
27   <div class="span4">
28     <h3>Top Scoring Players</h3>
29     <table class="table table-bordered table-condensed">
30       <thead>
31         <tr>
32           <th>#</th>
33           <th>Nick</th>
34           <th>Score</th>
35         </tr>
36       </thead>
37       <tbody>
38         <% i = 1 %>
39         % for (score_player_id, score_nick, score_value) in top_scorers:
40         <tr>
41           <td>${i}</td>
42           % if score_player_id != '-':
43           <td><a href="${request.route_url('player_info', id=score_player_id)}" title="Go to the player info page for this player">${score_nick|n}</a></td>
44           % else:
45           <td>${score_nick}</td>
46           % endif
47           <td>${score_value}</td>
48         </tr>
49         <% i = i+1 %>
50         % endfor
51         </tbody>
52     </table>
53   </div>
54
55
56 <div class="span4">
57   <h3>Most Active Players</h3>
58   <table class="table table-bordered table-condensed">
59     <thead>
60       <tr>
61         <th>#</th>
62         <th>Nick</th>
63         <th>Playing Time</th>
64       </tr>
65     </thead>
66     <tbody>
67     <% i = 1 %>
68     % for (player_id, nick, alivetime) in top_players:
69       <tr>
70         <td>${i}</td>
71         % if player_id != '-':
72         <td><a href="${request.route_url('player_info', id=player_id)}" title="Go to the player info page for this player">${nick|n}</a></td>
73         % else:
74         <td>${nick}</td>
75         % endif
76         <td>${alivetime}</td>
77       </tr>
78       <% i = i+1 %>
79     % endfor
80     </tbody>
81   </table>
82 </div>
83
84
85 <div class="span4">
86   <h3>Most Active Servers</h3>
87   <table class="table table-bordered table-condensed">
88     <thead>
89       <tr>
90         <th>#</th>
91         <th>Name</th>
92         <th>Times Played</th>
93       </tr>
94     </thead>
95     <tbody>
96     <% i = 1 %>
97     % for (server_id, name, times_played) in top_servers:
98       <tr>
99         <td>${i}</td>
100         <td><a href="${request.route_url('server_info', id=server_id)}" title="Go to the server info page for this server">${name}</a></td>
101         <td>${times_played}</td>
102       </tr>
103       <% i = i+1 %>
104     % endfor
105     </tbody>
106 </table>
107 </div>
108 </div> <!-- /row -->
109
110 % if len(captimes) > 0:
111 <div class="row">
112   <div class="span6">
113     <h3>Best Flag Capture Times</h3>
114     <table class="table table-bordered table-condensed">
115       <thead>
116         <tr>
117            <th>Nick</th>
118            <th>Captime</th>
119         </tr>
120       </thead>
121       <tbody>
122       % for c in captimes:
123         <tr>
124           <td>
125           % if c.player_id > 2:
126             <a href="${request.route_url("player_info", id=c.player_id)}"
127              title="Go to the info page for this player">
128             <span class="nick">${c.nick_html_colors|n}</span>
129             </a>
130           % else:
131             <span class="nick">${c.nick_html_colors|n}</span>
132           % endif
133           </td>
134           <td>
135             <a href="${request.route_url("game_info", id=c.game_id)}"
136              title="View the game in which this cap was made">
137               ${round(float(c.fastest_cap.seconds) + (c.fastest_cap.microseconds/1000000.0), 2)}
138             </a>
139           </td>
140         </tr>
141       % endfor
142       </tbody>
143     </table>
144   </div>
145 </div>
146 % endif
147
148
149 <div class="row">
150   <div class="span12">
151     <h3>Recent Games</h3>
152     <table class="table table-bordered table-condensed">
153       <thead>
154         <tr>
155           <th></th>
156           <th>Type</th>
157           <th>Server</th>
158           <th>Time</th>
159           <th>Winner</th>
160         </tr>
161       </thead>
162       <tbody>
163         % for rg in recent_games:
164         <tr>
165           <td><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>
166           <td class="gt_icon"><img title="${rg.game_type_cd}" src="/static/images/icons/24x24/${rg.game_type_cd}.png" alt="${rg.game_type_cd}" /></td>
167           <td><a href="${request.route_url('server_info', id=rg.server_id)}" title="Go to the detail page for this server">${rg.server_name}</a></td>
168           <td><span class="abstime" data-epoch="${rg.epoch}" title="${rg.create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${rg.fuzzy_date}</span></td>
169           <td>
170             % if rg.player_id > 2:
171             <a href="${request.route_url('player_info', id=rg.player_id)}" title="Go to the player info page for this player">${rg.nick_html_colors|n}</a>
172             % else:
173             ${rg.nick_html_colors|n}
174             % endif
175           </td>
176         </tr>
177         % endfor
178       </tbody>
179     </table>
180   </div>
181 </div>
182
183
184 % endif