]> git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/scoreboard.mako
00c9185b10610c1211c6627e2b64f4c10a75530e
[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 == 'dm' or game_type_cd == 'tdm' or game_type_cd == 'duel':
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="score">Score</th>
52       % if show_elo:
53       <th>Elo Change</th>
54       % endif
55     </tr>
56     </thead>
57 % endif
58
59 % if game_type_cd == 'ctf':
60     <thead class="ctf ${pgstat.team_html_color()}">
61     <tr>
62       <th class="nick">Nick</th>
63       % if show_latency:
64       <th class="ping">Ping</th>
65       % endif
66       <th class="kills">Kills</th>
67       <th class="captures">Captures</th>
68       <th class="pickups">Pickups</th>
69       <th class="fck" title="Flag Carrier Kill">FCK</th>
70       <th class="returns">Returns</th>
71       <th class="score">Score</th>
72       % if show_elo:
73       <th>Elo Change</th>
74       % endif
75     </tr>
76     </thead>
77 % endif
78
79 % if game_type_cd == 'ca':
80     <thead class="ca ${pgstat.team_html_color()}">
81     <tr>
82       <th class="nick">Nick</th>
83       % if show_latency:
84       <th class="ping">Ping</th>
85       % endif
86       <th class="kills">Kills</th>
87       <th class="score">Score</th>
88       % if show_elo:
89       <th>Elo Change</th>
90       % endif
91     </tr>
92     </thead>
93 % endif
94
95 % if game_type_cd == 'freezetag':
96     <thead class="freezetag ${pgstat.team_html_color()}">
97     <tr>
98       <th class="nick">Nick</th>
99       % if show_latency:
100       <th class="ping">Ping</th>
101       % endif
102       <th class="kills">Kills</th>
103       <th class="deaths">Deaths</th>
104       <th class="suicides">Suicides</th>
105       <th class="score">Score</th>
106       % if show_elo:
107       <th>Elo Change</th>
108       % endif
109     </tr>
110     </thead>
111 % endif
112 </%def>
113
114 ##### SCOREBOARD ROWS #####
115 <%def name="scoreboard_row(game_type_cd, pgstat)">
116 % if game_type_cd == 'dm' or game_type_cd == 'tdm' or game_type_cd == 'duel':
117         <td>${pgstat.kills}</td>
118         <td>${pgstat.deaths}</td>
119         <td>${pgstat.suicides}</td>
120 % endif
121
122 % if game_type_cd == 'ctf':
123         <td>${pgstat.kills}</td>
124         <td>${pgstat.captures}</td>
125         <td>${pgstat.pickups}</td>
126         <td>${pgstat.carrier_frags}</td>
127         <td>${pgstat.returns}</td>
128 % endif
129
130 % if game_type_cd == 'ca':
131         <td>${pgstat.kills}</td>
132 % endif
133
134 % if game_type_cd == 'freezetag':
135         <td>${pgstat.kills}</td>
136         <td>${pgstat.deaths}</td>
137         <td>${pgstat.suicides}</td>
138 % endif
139 </%def>