]> git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/scoreboard.mako
Add assault support to the scoreboard
[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 == 'dm' or game_type_cd == 'tdm' or game_type_cd == 'duel':
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 == 'ctf':
79     <thead class="ctf ${pgstat.team_html_color()}">
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="captures">Captures</th>
87       <th class="pickups">Pickups</th>
88       <th class="fck" title="Flag Carrier Kill">FCK</th>
89       <th class="returns">Returns</th>
90       <th class="score">Score</th>
91       % if show_elo:
92       <th>Elo Change</th>
93       % endif
94     </tr>
95     </thead>
96 % endif
97
98 % if game_type_cd == 'ca':
99     <thead class="ca ${pgstat.team_html_color()}">
100     <tr>
101       <th class="nick">Nick</th>
102       % if show_latency:
103       <th class="ping">Ping</th>
104       % endif
105       <th class="kills">Kills</th>
106       <th class="score">Score</th>
107       % if show_elo:
108       <th>Elo Change</th>
109       % endif
110     </tr>
111     </thead>
112 % endif
113
114 % if game_type_cd == 'freezetag':
115     <thead class="freezetag ${pgstat.team_html_color()}">
116     <tr>
117       <th class="nick">Nick</th>
118       % if show_latency:
119       <th class="ping">Ping</th>
120       % endif
121       <th class="kills">Kills</th>
122       <th class="deaths">Deaths</th>
123       <th class="suicides">Suicides</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 </%def>
132
133 ##### SCOREBOARD ROWS #####
134 <%def name="scoreboard_row(game_type_cd, pgstat)">
135 % if game_type_cd == 'as':
136         <td>${pgstat.kills}</td>
137         <td>${pgstat.deaths}</td>
138         <td>${pgstat.suicides}</td>
139         <td>${pgstat.collects}</td>
140 % endif
141
142 % if game_type_cd == 'dm' or game_type_cd == 'tdm' or game_type_cd == 'duel':
143         <td>${pgstat.kills}</td>
144         <td>${pgstat.deaths}</td>
145         <td>${pgstat.suicides}</td>
146 % endif
147
148 % if game_type_cd == 'ctf':
149         <td>${pgstat.kills}</td>
150         <td>${pgstat.captures}</td>
151         <td>${pgstat.pickups}</td>
152         <td>${pgstat.carrier_frags}</td>
153         <td>${pgstat.returns}</td>
154 % endif
155
156 % if game_type_cd == 'ca':
157         <td>${pgstat.kills}</td>
158 % endif
159
160 % if game_type_cd == 'freezetag':
161         <td>${pgstat.kills}</td>
162         <td>${pgstat.deaths}</td>
163         <td>${pgstat.suicides}</td>
164 % endif
165 </%def>