]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/scoreboard.mako
Add ping to the scoreboard.
[xonotic/xonstat.git] / xonstat / templates / scoreboard.mako
1 <%def name="scoreboard(game_type_cd, pgstats)">
2 <table  class="table table-bordered 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       <td>
8       % if pgstat.player_id > 2:
9         <a href="${request.route_url("player_info", id=pgstat.player_id)}"
10          title="Go to the info page for this player">
11         <span class="nick">${pgstat.nick_html_colors()|n}</span>
12         </a>
13       % else:
14         <span class="nick">${pgstat.nick_html_colors()|n}</span>
15       % endif
16       </td>
17       % if pgstat.avg_latency is not None:
18       <td>
19         ${int(round(pgstat.avg_latency))}
20       </td>
21       % endif
22     ${scoreboard_row(game_type_cd, pgstat)}
23       <td>${pgstat.score}</td>
24     </tr>
25   % endfor
26   </tbody>
27 </table>
28 </%def>
29
30 ##### SCOREBOARD HEADER #####
31 <%def name="scoreboard_header(game_type_cd, pgstat)">
32 % if game_type_cd == 'dm' or game_type_cd == 'tdm' or game_type_cd == 'duel':
33     <thead>
34     <tr>
35       <th class="nick">Nick</th>
36       % if pgstat.avg_latency is not None:
37       <th class="ping">Ping</th>
38       % endif
39       <th class="kills">Kills</th>
40       <th class="deaths">Deaths</th>
41       <th class="suicides">Suicides</th>
42       <th class="score">Score</th>
43     </tr>
44     </thead>
45 % endif
46
47 % if game_type_cd == 'ctf':
48     <thead class="ctf ${pgstat.team_html_color()}">
49     <tr>
50       <th class="nick">Nick</th>
51       % if pgstat.avg_latency is not None:
52       <th class="ping">Ping</th>
53       % endif
54       <th class="kills">Kills</th>
55       <th class="captures">Captures</th>
56       <th class="pickups">Pickups</th>
57       <th class="fck" title="Flag Carrier Kill">FCK</th>
58       <th class="returns">Returns</th>
59       <th class="score">Score</th>
60     </tr>
61     </thead>
62 % endif
63
64 % if game_type_cd == 'ca':
65     <thead class="ca ${pgstat.team_html_color()}">
66     <tr>
67       <th class="nick">Nick</th>
68       % if pgstat.avg_latency is not None:
69       <th class="ping">Ping</th>
70       % endif
71       <th class="kills">Kills</th>
72       <th class="score">Score</th>
73     </tr>
74     </thead>
75 % endif
76
77 % if game_type_cd == 'freezetag':
78     <thead class="freezetag ${pgstat.team_html_color()}">
79     <tr>
80       <th class="nick">Nick</th>
81       % if pgstat.avg_latency is not None:
82       <th class="ping">Ping</th>
83       % endif
84       <th class="kills">Kills</th>
85       <th class="deaths">Deaths</th>
86       <th class="suicides">Suicides</th>
87       <th class="score">Score</th>
88     </tr>
89     </thead>
90 % endif
91 </%def>
92
93 ##### SCOREBOARD ROWS #####
94 <%def name="scoreboard_row(game_type_cd, pgstat)">
95 % if game_type_cd == 'dm' or game_type_cd == 'tdm' or game_type_cd == 'duel':
96         <td>${pgstat.kills}</td>
97         <td>${pgstat.deaths}</td>
98         <td>${pgstat.suicides}</td>
99 % endif
100
101 % if game_type_cd == 'ctf':
102         <td>${pgstat.kills}</td>
103         <td>${pgstat.captures}</td>
104         <td>${pgstat.pickups}</td>
105         <td>${pgstat.carrier_frags}</td>
106         <td>${pgstat.returns}</td>
107 % endif
108
109 % if game_type_cd == 'ca':
110         <td>${pgstat.kills}</td>
111 % endif
112
113 % if game_type_cd == 'freezetag':
114         <td>${pgstat.kills}</td>
115         <td>${pgstat.deaths}</td>
116         <td>${pgstat.suicides}</td>
117 % endif
118 </%def>