]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/scoreboard.mako
Add the template as well.
[xonotic/xonstat.git] / xonstat / templates / scoreboard.mako
1 <%def name="scoreboard(game_type_cd, pgstats, show_elo=False, show_latency=False)">
2 <table  class="table-hover table-condensed">
3   ${scoreboard_header(game_type_cd, pgstats[0])}
4   <tbody>
5   % for pgstat in pgstats:
6     <tr class="${pgstat.team_html_color()}">
7       % if show_latency and pgstat.avg_latency is not None:
8         <td class="show-for-medium-up text-center">
9           ${int(round(pgstat.avg_latency))}
10         </td>
11       % elif show_latency:
12         <td class="show-for-medium-up text-center">-</td>
13       % endif
14
15       <td class="small-5 medium-3 no-stretch">
16         % if pgstat.player_id > 2:
17           <a href="${request.route_url("player_info", id=pgstat.player_id)}" title="Go to the info page for this player">
18             ${pgstat.nick_html_colors()|n}
19           </a>
20         % else:
21           ${pgstat.nick_html_colors()|n}
22         % endif
23       </td>
24
25       ${scoreboard_row(game_type_cd, pgstat)}
26
27       % if game_type_cd != 'cts':
28         <td class="small-3 player-score">${pgstat.score}</td>
29       % endif
30
31       % if show_elo:
32         % if pgstat.elo_delta is not None:
33           <td class="show-for-medium-up">${round(pgstat.elo_delta,2)}</td>
34         % else:
35           <td class="show-for-medium-up">-</td>
36         % endif
37       % endif
38     </tr>
39   % endfor
40   </tbody>
41 </table>
42 </%def>
43
44 ##### SCOREBOARD HEADER #####
45 <%def name="scoreboard_header(game_type_cd, pgstat)">
46 % if game_type_cd == 'as':
47 <thead>
48   <tr>
49     % if show_latency:
50       <th class="small-1">Ping</th>
51     % endif
52     <th class="small-4">Nick</th>
53     <th>Kills</th>
54     <th>Deaths</th>
55     <th>Suicides</th>
56     <th>Objectives</th>
57     <th class="medium-1">Score</th>
58     % if show_elo:
59       <th>Elo Change</th>
60     % endif
61   </tr>
62 </thead>
63 % endif
64
65 % if game_type_cd in 'ca' 'dm' 'duel' 'rune' 'tdm':
66 <thead>
67   <tr>
68     % if show_latency:
69       <th class="show-for-medium-up medium-1">Ping</th>
70     % endif
71     <th class="small-5 medium-3">Nick</th>
72     <th>Kills</th>
73     <th class="show-for-medium-up">Deaths</th>
74     <th class="show-for-medium-up">Suicides</th>
75     <th class="small-3 medium-1">Score</th>
76     % if show_elo:
77       <th class="show-for-medium-up">Elo Change</th>
78     % endif
79   </tr>
80 </thead>
81 % endif
82
83 % if game_type_cd == 'cq':
84 <thead>
85   <tr>
86     % if show_latency:
87       <th class="small-1">Ping</th>
88     % endif
89     <th class="small-2">Nick</th>
90     <th>Kills</th>
91     <th>Deaths</th>
92     <th>Captured</th>
93     <th>Released</th>
94     <th>Score</th>
95     % if show_elo:
96       <th>Elo Change</th>
97     % endif
98   </tr>
99 </thead>
100 % endif
101
102 % if game_type_cd == 'cts':
103 <thead>
104   <tr>
105     % if show_latency:
106       <th class="small-1">Ping</th>
107     % endif
108     <th class="small-2">Nick</th>
109     <th>Fastest Time</th>
110     <th>Deaths</th>
111   </tr>
112 </thead>
113 % endif
114
115 % if game_type_cd == 'ctf':
116 <thead class="ctf ${pgstat.team_html_color()}">
117   <tr>
118     % if show_latency:
119       <th class="show-for-medium-up medium-1">Ping</th>
120     % endif
121     <th class="small-5 medium-3">Nick</th>
122     <th class="show-for-medium-up">Kills</th>
123     <th>Caps</th>
124     <th class="show-for-medium-up">Pickups</th>
125     <th class="show-for-medium-up" title="Flag Carrier Kill">FCK</th>
126     <th class="show-for-medium-up">Returns</th>
127     <th class="medium-1">Score</th>
128     % if show_elo:
129       <th>Elo Change</th>
130     % endif
131   </tr>
132 </thead>
133 % endif
134
135 % if game_type_cd == 'dom':
136 <thead class="dom ${pgstat.team_html_color()}">
137   <tr>
138     % if show_latency:
139       <th class="small-1">Ping</th>
140     % endif
141     <th class="small-2">Nick</th>
142     <th>Kills</th>
143     <th>Deaths</th>
144     <th>Takes</th>
145     <th>Ticks</th>
146     <th>Score</th>
147     % if show_elo:
148       <th>Elo Change</th>
149     % endif
150   </tr>
151 </thead>
152 % endif
153
154 % if game_type_cd in 'ft' 'freezetag':
155 <thead class="freezetag ${pgstat.team_html_color()}">
156   <tr>
157     % if show_latency:
158       <th class="small-1">Ping</th>
159     % endif
160     <th class="small-2">Nick</th>
161     <th>Kills</th>
162     <th>Deaths</th>
163     <th>Revivals</th>
164     <th>Score</th>
165     % if show_elo:
166       <th>Elo Change</th>
167     % endif
168   </tr>
169 </thead>
170 % endif
171
172 % if game_type_cd in 'ka' 'keepaway':
173 <thead>
174   <tr>
175     % if show_latency:
176       <th class="small-1">Ping</th>
177     % endif
178     <th class="small-2">Nick</th>
179     <th>Kills</th>
180     <th>Deaths</th>
181     <th>Pickups</th>
182     <th>BC Time</th>
183     <th>BC Kills</th>
184     <th>Score</th>
185     % if show_elo:
186       <th>Elo Change</th>
187     % endif
188   </tr>
189 </thead>
190 % endif
191
192 % if game_type_cd == 'kh':
193 <thead class="kh ${pgstat.team_html_color()}">
194   <tr>
195     % if show_latency:
196       <th class="show-for-medium-up medium-1">Ping</th>
197     % endif
198     <th class="small-5 medium-3">Nick</th>
199     <th class="show-for-medium-up">Kills</th>
200     <th class="show-for-medium-up">Deaths</th>
201     <th class="show-for-medium-up">Pickups</th>
202     <th>Caps</th>
203     <th class="show-for-medium-up">Losses</th>
204     <th class="show-for-medium-up">KC Kills</th>
205     <th class="small-3 medium-1">Score</th>
206     % if show_elo:
207       <th class="show-for-medium-up">Elo Change</th>
208     % endif
209   </tr>
210 </thead>
211 % endif
212
213 % if game_type_cd in 'nb' 'nexball':
214 <thead class="nb ${pgstat.team_html_color()}">
215   <tr>
216     % if show_latency:
217       <th class="small-1">Ping</th>
218     % endif
219     <th class="small-2">Nick</th>
220     <th>Goals</th>
221     <th>Faults</th>
222     <th>Score</th>
223     % if show_elo:
224       <th>Elo Change</th>
225     % endif
226   </tr>
227 </thead>
228 % endif
229
230 % if game_type_cd == 'rc':
231 <thead>
232   <tr>
233     % if show_latency:
234       <th class="small-1">Ping</th>
235     % endif
236     <th class="small-2">Nick</th>
237     <th>Laps</th>
238     <th>Fastest Lap</th>
239     <th>Time</th>
240   </tr>
241 </thead>
242 % endif
243
244 </%def>
245
246 ##### SCOREBOARD ROWS #####
247 <%def name="scoreboard_row(game_type_cd, pgstat)">
248 % if game_type_cd == 'as':
249   <td>${pgstat.kills}</td>
250   <td>${pgstat.deaths}</td>
251   <td>${pgstat.suicides}</td>
252   <td>${pgstat.collects}</td>
253 % endif
254
255 % if game_type_cd in 'ca' 'dm' 'duel' 'rune' 'tdm':
256   <td class="small-3">${pgstat.kills}</td>
257   <td class="show-for-medium-up">${pgstat.deaths}</td>
258   <td class="show-for-medium-up">${pgstat.suicides}</td>
259 % endif
260
261 % if game_type_cd == 'cq':
262   <td>${pgstat.kills}</td>
263   <td>${pgstat.deaths}</td>
264   <td>${pgstat.captures}</td>
265   <td>${pgstat.drops}</td>
266 % endif
267
268 % if game_type_cd == 'cts':
269   % if pgstat.fastest is not None:
270     <td>${round(float(pgstat.fastest.seconds) + (pgstat.fastest.microseconds/1000000.0), 2)}</td>
271   % else:
272     <td>-</td>
273   % endif
274
275   <td>${pgstat.deaths}</td>
276 % endif
277
278 % if game_type_cd == 'ctf':
279   <td class="show-for-medium-up">${pgstat.kills}</td>
280   <td>${pgstat.captures}</td>
281   <td class="show-for-medium-up">${pgstat.pickups}</td>
282   <td class="show-for-medium-up">${pgstat.carrier_frags}</td>
283   <td class="show-for-medium-up">${pgstat.returns}</td>
284 % endif
285
286 % if game_type_cd == 'dom':
287   <td>${pgstat.kills}</td>
288   <td>${pgstat.deaths}</td>
289   <td>${pgstat.pickups}</td>
290   <td>${pgstat.drops}</td>
291 % endif
292
293 % if game_type_cd in 'ft' 'freezetag':
294   <td>${pgstat.kills}</td>
295   <td>${pgstat.deaths}</td>
296   <td>${pgstat.revivals}</td>
297 % endif
298
299 % if game_type_cd in 'ka' 'keepaway':
300   <td>${pgstat.kills}</td>
301   <td>${pgstat.deaths}</td>
302   <td>${pgstat.pickups}</td>
303
304   % if pgstat.time is not None:
305     <td>${round(float(pgstat.time.seconds) + (pgstat.time.microseconds/1000000.0), 2)}</td>
306   % else:
307     <td>-</td>
308   % endif
309
310   <td>${pgstat.carrier_frags}</td>
311 % endif
312
313 % if game_type_cd == 'kh':
314   <td class="show-for-medium-up">${pgstat.kills}</td>
315   <td class="show-for-medium-up">${pgstat.deaths}</td>
316   <td class="show-for-medium-up">${pgstat.pickups}</td>
317   <td class="show-for-medium-up">${pgstat.captures}</td>
318   <td class="show-for-medium-up">${pgstat.drops}</td>
319   <td>${pgstat.carrier_frags}</td>
320 % endif
321
322 % if game_type_cd in 'nb' 'nexball':
323   <td>${pgstat.captures}</td>
324   <td>${pgstat.drops}</td>
325 % endif
326
327 % if game_type_cd == 'rc':
328   <td>${pgstat.laps}</td>
329
330   % if pgstat.fastest is not None:
331     <td>${round(float(pgstat.fastest.seconds) + (pgstat.fastest.microseconds/1000000.0), 2)}</td>
332   % else:
333     <td>-</td>
334   % endif
335
336   % if pgstat.time is not None:
337     <td>${round(float(pgstat.time.seconds) + (pgstat.time.microseconds/1000000.0), 2)}</td>
338   % else:
339     <td>-</td>
340   % endif
341 % endif
342
343 </%def>