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