1 <%def name="scoreboard(game_type_cd, pgstats, teams=None, show_elo=False, show_latency=False)">
2 ##teams: { scoreboardpos : ( teamname, teamscore, playercount ) }
4 <table class="table table-condensed">
5 <tbody><tr class="teamscores">
6 % for team,score in sorted(teamscores.items(), key=lambda x:x[1], reverse=True):
7 <td class="${team} teamscore" width="${100/len(teamscores)}%">${team.capitalize()} Team: ${score}</td>
13 <table class="table table-hover table-condensed">
14 ${scoreboard_header(game_type_cd, pgstats[0])}
16 % for pgstat in pgstats:
17 <tr class="${pgstat.team_html_color()}">
18 <td class="nostretch">
19 % if pgstat.player_id > 2:
20 <a href="${request.route_url("player_info", id=pgstat.player_id)}"
21 title="Go to the info page for this player">
22 <span class="nick">${pgstat.nick_html_colors()|n}</span>
25 <span class="nick">${pgstat.nick_html_colors()|n}</span>
28 % if show_latency and pgstat.avg_latency is not None:
29 <td class="scoreboard-entry">
30 ${int(round(pgstat.avg_latency))}
33 <td class="scoreboard-entry"></td>
35 ${scoreboard_row(game_type_cd, pgstat)}
36 % if game_type_cd != 'cts':
37 <td class="scoreboard-entry">${pgstat.score}</td>
40 % if pgstat.elo_delta is not None:
41 <td class="scoreboard-entry">${round(pgstat.elo_delta,2)}</td>
43 <td class="scoreboard-entry">-</td>
47 ##% if teams.has_key(pgstat.scoreboardpos):
48 ##<td class="scoreboard-entry teamscore" rowspan="${teams[pgstat.scoreboardpos].playercount}">${teams[pgstat.scoreboardpos].teamscore}</td>
57 ##### SCOREBOARD HEADER #####
58 <%def name="scoreboard_header(game_type_cd, pgstat)">
59 % if game_type_cd == 'as':
62 <th class="nick">Nick</th>
64 <th class="ping">Ping</th>
66 <th class="kills">Kills</th>
67 <th class="deaths">Deaths</th>
68 <th class="suicides">Suicides</th>
69 <th class="objectives">Objectives</th>
70 <th class="score">Score</th>
72 ##<th class="teamscore">Teamscore</th>
81 % if game_type_cd in 'ca' 'dm' 'duel' 'rune' 'tdm':
84 <th class="nick">Nick</th>
86 <th class="ping">Ping</th>
88 <th class="kills">Kills</th>
89 <th class="deaths">Deaths</th>
90 <th class="suicides">Suicides</th>
91 <th class="score">Score</th>
93 ##<th class="teamscore">Teamscore</th>
102 % if game_type_cd == 'cq':
105 <th class="nick">Nick</th>
107 <th class="ping">Ping</th>
109 <th class="kills">Kills</th>
110 <th class="deaths">Deaths</th>
111 <th class="captured">Captured</th>
112 <th class="released">Released</th>
113 <th class="score">Score</th>
115 ##<th>Elo Change</th>
121 % if game_type_cd == 'cts':
124 <th class="nick">Nick</th>
126 <th class="ping">Ping</th>
128 <th class="fastest">Fastest Time</th>
129 <th class="deaths">Deaths</th>
134 % if game_type_cd == 'ctf':
135 <thead class="ctf ${pgstat.team_html_color()}">
137 <th class="nick">Nick</th>
139 <th class="ping">Ping</th>
141 <th class="kills">Kills</th>
142 <th class="captures">Captures</th>
143 <th class="pickups">Pickups</th>
144 <th class="fck" title="Flag Carrier Kill">FCK</th>
145 <th class="returns">Returns</th>
146 <th class="score">Score</th>
148 ##<th class="teamscore">Teamscore</th>
157 % if game_type_cd == 'dom':
158 <thead class="dom ${pgstat.team_html_color()}">
160 <th class="nick">Nick</th>
162 <th class="ping">Ping</th>
164 <th class="kills">Kills</th>
165 <th class="deaths">Deaths</th>
166 <th class="takes">Takes</th>
167 <th class="ticks">Ticks</th>
168 <th class="score">Score</th>
170 ##<th class="teamscore">Teamscore</th>
179 % if game_type_cd in 'ft' 'freezetag':
180 <thead class="freezetag ${pgstat.team_html_color()}">
182 <th class="nick">Nick</th>
184 <th class="ping">Ping</th>
186 <th class="kills">Kills</th>
187 <th class="deaths">Deaths</th>
188 <th class="revivals">Revivals</th>
189 <th class="score">Score</th>
191 ##<th class="teamscore">Teamscore</th>
200 % if game_type_cd in 'ka' 'keepaway':
203 <th class="nick">Nick</th>
205 <th class="ping">Ping</th>
207 <th class="kills">Kills</th>
208 <th class="deaths">Deaths</th>
209 <th class="pickups">Pickups</th>
210 <th class="bctime">BC Time</th>
211 <th class="bckills">BC Kills</th>
213 ##<th class="teamscore">Teamscore</th>
222 % if game_type_cd == 'kh':
223 <thead class="kh ${pgstat.team_html_color()}">
225 <th class="nick">Nick</th>
227 <th class="ping">Ping</th>
229 <th class="kills">Kills</th>
230 <th class="deaths">Deaths</th>
231 <th class="pickups">Pickups</th>
232 <th class="caps">Captures</th>
233 <th class="losses">Losses</th>
234 <th class="pushes">Pushes</th>
235 <th class="destroys">Destroys</th>
236 <th class="kckills">KC Kills</th>
237 <th class="score">Score</th>
239 ##<th class="teamscore">Teamscore</th>
248 % if game_type_cd in 'nb' 'nexball':
249 <thead class="nb ${pgstat.team_html_color()}">
251 <th class="nick">Nick</th>
253 <th class="ping">Ping</th>
255 <th class="goals">Goals</th>
256 <th class="faults">Faults</th>
257 <th class="score">Score</th>
259 ##<th class="teamscore">Teamscore</th>
268 % if game_type_cd == 'rc':
271 <th class="nick">Nick</th>
273 <th class="ping">Ping</th>
275 <th class="laps">Laps</th>
276 <th class="fastest">Fastest Lap</th>
277 <th class="time">Time</th>
284 ##### SCOREBOARD ROWS #####
285 <%def name="scoreboard_row(game_type_cd, pgstat)">
286 % if game_type_cd == 'as':
287 <td class="scoreboard-entry">${pgstat.kills}</td>
288 <td class="scoreboard-entry">${pgstat.deaths}</td>
289 <td class="scoreboard-entry">${pgstat.suicides}</td>
290 <td class="scoreboard-entry">${pgstat.collects}</td>
293 % if game_type_cd in 'ca' 'dm' 'duel' 'rune' 'tdm':
294 <td class="scoreboard-entry">${pgstat.kills}</td>
295 <td class="scoreboard-entry">${pgstat.deaths}</td>
296 <td class="scoreboard-entry">${pgstat.suicides}</td>
299 % if game_type_cd == 'cq':
300 <td class="scoreboard-entry">${pgstat.kills}</td>
301 <td class="scoreboard-entry">${pgstat.deaths}</td>
302 <td class="scoreboard-entry">${pgstat.captures}</td>
303 <td class="scoreboard-entry">${pgstat.drops}</td>
306 % if game_type_cd == 'cts':
307 % if pgstat.fastest is not None:
308 <td class="scoreboard-entry">${round(float(pgstat.fastest.seconds) + (pgstat.fastest.microseconds/1000000.0), 2)}</td>
310 <td class="scoreboard-entry">-</td>
312 <td class="scoreboard-entry">${pgstat.deaths}</td>
315 % if game_type_cd == 'ctf':
316 <td class="scoreboard-entry">${pgstat.kills}</td>
317 <td class="scoreboard-entry">${pgstat.captures}</td>
318 <td class="scoreboard-entry">${pgstat.pickups}</td>
319 <td class="scoreboard-entry">${pgstat.carrier_frags}</td>
320 <td class="scoreboard-entry">${pgstat.returns}</td>
323 % if game_type_cd == 'dom':
324 <td class="scoreboard-entry">${pgstat.kills}</td>
325 <td class="scoreboard-entry">${pgstat.deaths}</td>
326 <td class="scoreboard-entry">${pgstat.pickups}</td>
327 <td class="scoreboard-entry">${pgstat.drops}</td>
330 % if game_type_cd in 'ft' 'freezetag':
331 <td class="scoreboard-entry">${pgstat.kills}</td>
332 <td class="scoreboard-entry">${pgstat.deaths}</td>
333 <td class="scoreboard-entry">${pgstat.revivals}</td>
336 % if game_type_cd in 'ka' 'keepaway':
337 <td class="scoreboard-entry">${pgstat.kills}</td>
338 <td class="scoreboard-entry">${pgstat.deaths}</td>
339 <td class="scoreboard-entry">${pgstat.pickups}</td>
341 % if pgstat.time is not None:
342 <td class="scoreboard-entry">${round(float(pgstat.time.seconds) + (pgstat.time.microseconds/1000000.0), 2)}</td>
344 <td class="scoreboard-entry">-</td>
347 <td class="scoreboard-entry">${pgstat.fckills}</td>
350 % if game_type_cd == 'kh':
351 <td class="scoreboard-entry">${pgstat.kills}</td>
352 <td class="scoreboard-entry">${pgstat.deaths}</td>
353 <td class="scoreboard-entry">${pgstat.pickups}</td>
354 <td class="scoreboard-entry">${pgstat.captures}</td>
355 <td class="scoreboard-entry">${pgstat.drops}</td>
356 <td class="scoreboard-entry">${pgstat.pushes}</td>
357 <td class="scoreboard-entry">${pgstat.destroys}</td>
358 <td class="scoreboard-entry">${pgstat.carrier_frags}</td>
361 % if game_type_cd in 'nb' 'nexball':
362 <td class="scoreboard-entry">${pgstat.captures}</td>
363 <td class="scoreboard-entry">${pgstat.drops}</td>
366 % if game_type_cd == 'rc':
367 <td class="scoreboard-entry">${pgstat.laps}</td>
369 % if pgstat.fastest is not None:
370 <td class="scoreboard-entry">${round(float(pgstat.fastest.seconds) + (pgstat.fastest.microseconds/1000000.0), 2)}</td>
372 <td class="scoreboard-entry">-</td>
375 % if pgstat.time is not None:
376 <td class="scoreboard-entry">${round(float(pgstat.time.seconds) + (pgstat.time.microseconds/1000000.0), 2)}</td>
378 <td class="scoreboard-entry">-</td>