]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/scoreboard.mako
Clean up scoreboard and accuracy info for CTS.
[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 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 show_latency and pgstat.avg_latency is not None:
18       <td>
19         ${int(round(pgstat.avg_latency))}
20       </td>
21       % elif show_latency:
22       <td></td>
23       % endif
24       ${scoreboard_row(game_type_cd, pgstat)}
25       % if game_type_cd != 'cts':
26       <td>${pgstat.score}</td>
27       % endif
28       % if show_elo:
29         % if pgstat.elo_delta is not None:
30         <td>${round(pgstat.elo_delta,2)}</td>
31         % else:
32         <td>-</td>
33         % endif
34       % endif
35     </tr>
36   % endfor
37   </tbody>
38 </table>
39 </%def>
40
41 ##### SCOREBOARD HEADER #####
42 <%def name="scoreboard_header(game_type_cd, pgstat)">
43 % if game_type_cd == 'as':
44     <thead>
45     <tr>
46       <th class="nick">Nick</th>
47       % if show_latency:
48       <th class="ping">Ping</th>
49       % endif
50       <th class="kills">Kills</th>
51       <th class="deaths">Deaths</th>
52       <th class="suicides">Suicides</th>
53       <th class="objectives">Objectives</th>
54       <th class="score">Score</th>
55       % if show_elo:
56       <th>Elo Change</th>
57       % endif
58     </tr>
59     </thead>
60 % endif
61
62 % if game_type_cd in 'ca' 'dm' 'duel' 'tdm':
63     <thead>
64     <tr>
65       <th class="nick">Nick</th>
66       % if show_latency:
67       <th class="ping">Ping</th>
68       % endif
69       <th class="kills">Kills</th>
70       <th class="deaths">Deaths</th>
71       <th class="suicides">Suicides</th>
72       <th class="score">Score</th>
73       % if show_elo:
74       <th>Elo Change</th>
75       % endif
76     </tr>
77     </thead>
78 % endif
79
80 % if game_type_cd == 'cq':
81     <thead>
82     <tr>
83       <th class="nick">Nick</th>
84       % if show_latency:
85       <th class="ping">Ping</th>
86       % endif
87       <th class="kills">Kills</th>
88       <th class="deaths">Deaths</th>
89       <th class="captured">Captured</th>
90       <th class="released">Released</th>
91       <th class="score">Score</th>
92       % if show_elo:
93       <th>Elo Change</th>
94       % endif
95     </tr>
96     </thead>
97 % endif
98
99 % if game_type_cd == 'cts':
100     <thead>
101     <tr>
102       <th class="nick">Nick</th>
103       % if show_latency:
104       <th class="ping">Ping</th>
105       % endif
106       <th class="fastest">Fastest Lap</th>
107       <th class="deaths">Deaths</th>
108     </tr>
109     </thead>
110 % endif
111
112 % if game_type_cd == 'ctf':
113     <thead class="ctf ${pgstat.team_html_color()}">
114     <tr>
115       <th class="nick">Nick</th>
116       % if show_latency:
117       <th class="ping">Ping</th>
118       % endif
119       <th class="kills">Kills</th>
120       <th class="captures">Captures</th>
121       <th class="pickups">Pickups</th>
122       <th class="fck" title="Flag Carrier Kill">FCK</th>
123       <th class="returns">Returns</th>
124       <th class="score">Score</th>
125       % if show_elo:
126       <th>Elo Change</th>
127       % endif
128     </tr>
129     </thead>
130 % endif
131
132 % if game_type_cd == 'freezetag':
133     <thead class="freezetag ${pgstat.team_html_color()}">
134     <tr>
135       <th class="nick">Nick</th>
136       % if show_latency:
137       <th class="ping">Ping</th>
138       % endif
139       <th class="kills">Kills</th>
140       <th class="deaths">Deaths</th>
141       <th class="suicides">Suicides</th>
142       <th class="score">Score</th>
143       % if show_elo:
144       <th>Elo Change</th>
145       % endif
146     </tr>
147     </thead>
148 % endif
149 </%def>
150
151 ##### SCOREBOARD ROWS #####
152 <%def name="scoreboard_row(game_type_cd, pgstat)">
153 % if game_type_cd == 'as':
154         <td>${pgstat.kills}</td>
155         <td>${pgstat.deaths}</td>
156         <td>${pgstat.suicides}</td>
157         <td>${pgstat.collects}</td>
158 % endif
159
160 % if game_type_cd in 'ca' 'dm' 'duel' 'tdm':
161         <td>${pgstat.kills}</td>
162         <td>${pgstat.deaths}</td>
163         <td>${pgstat.suicides}</td>
164 % endif
165
166 % if game_type_cd == 'cq':
167         <td>${pgstat.kills}</td>
168         <td>${pgstat.deaths}</td>
169         <td>${pgstat.captures}</td>
170         <td>${pgstat.drops}</td>
171 % endif
172
173 % if game_type_cd == 'cts':
174         <td>${pgstat.fastest}</td>
175         <td>${pgstat.deaths}</td>
176 % endif
177
178 % if game_type_cd == 'ctf':
179         <td>${pgstat.kills}</td>
180         <td>${pgstat.captures}</td>
181         <td>${pgstat.pickups}</td>
182         <td>${pgstat.carrier_frags}</td>
183         <td>${pgstat.returns}</td>
184 % endif
185
186 % if game_type_cd == 'freezetag':
187         <td>${pgstat.kills}</td>
188         <td>${pgstat.deaths}</td>
189         <td>${pgstat.suicides}</td>
190 % endif
191 </%def>