]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/scoreboard.mako
Add views for player captimes (all the fastest caps per player) and map captimes...
[xonotic/xonstat.git] / xonstat / templates / scoreboard.mako
1 <%def name="scoreboard(game_type_cd, pgstats, show_elo=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 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       % if show_elo:
25         % if pgstat.elo_delta is not None:
26         <td>${round(pgstat.elo_delta,2)}</td>
27         % else:
28         <td>-</td>
29         % endif
30       % endif
31     </tr>
32   % endfor
33   </tbody>
34 </table>
35 </%def>
36
37 ##### SCOREBOARD HEADER #####
38 <%def name="scoreboard_header(game_type_cd, pgstat)">
39 % if game_type_cd == 'dm' or game_type_cd == 'tdm' or game_type_cd == 'duel':
40     <thead>
41     <tr>
42       <th class="nick">Nick</th>
43       % if pgstat.avg_latency is not None:
44       <th class="ping">Ping</th>
45       % endif
46       <th class="kills">Kills</th>
47       <th class="deaths">Deaths</th>
48       <th class="suicides">Suicides</th>
49       <th class="score">Score</th>
50       % if show_elo:
51       <th>Elo Change</th>
52       % endif
53     </tr>
54     </thead>
55 % endif
56
57 % if game_type_cd == 'ctf':
58     <thead class="ctf ${pgstat.team_html_color()}">
59     <tr>
60       <th class="nick">Nick</th>
61       % if pgstat.avg_latency is not None:
62       <th class="ping">Ping</th>
63       % endif
64       <th class="kills">Kills</th>
65       <th class="captures">Captures</th>
66       <th class="pickups">Pickups</th>
67       <th class="fck" title="Flag Carrier Kill">FCK</th>
68       <th class="returns">Returns</th>
69       <th class="score">Score</th>
70       % if show_elo:
71       <th>Elo Change</th>
72       % endif
73     </tr>
74     </thead>
75 % endif
76
77 % if game_type_cd == 'ca':
78     <thead class="ca ${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="score">Score</th>
86       % if show_elo:
87       <th>Elo Change</th>
88       % endif
89     </tr>
90     </thead>
91 % endif
92
93 % if game_type_cd == 'freezetag':
94     <thead class="freezetag ${pgstat.team_html_color()}">
95     <tr>
96       <th class="nick">Nick</th>
97       % if pgstat.avg_latency is not None:
98       <th class="ping">Ping</th>
99       % endif
100       <th class="kills">Kills</th>
101       <th class="deaths">Deaths</th>
102       <th class="suicides">Suicides</th>
103       <th class="score">Score</th>
104       % if show_elo:
105       <th>Elo Change</th>
106       % endif
107     </tr>
108     </thead>
109 % endif
110 </%def>
111
112 ##### SCOREBOARD ROWS #####
113 <%def name="scoreboard_row(game_type_cd, pgstat)">
114 % if game_type_cd == 'dm' or game_type_cd == 'tdm' or game_type_cd == 'duel':
115         <td>${pgstat.kills}</td>
116         <td>${pgstat.deaths}</td>
117         <td>${pgstat.suicides}</td>
118 % endif
119
120 % if game_type_cd == 'ctf':
121         <td>${pgstat.kills}</td>
122         <td>${pgstat.captures}</td>
123         <td>${pgstat.pickups}</td>
124         <td>${pgstat.carrier_frags}</td>
125         <td>${pgstat.returns}</td>
126 % endif
127
128 % if game_type_cd == 'ca':
129         <td>${pgstat.kills}</td>
130 % endif
131
132 % if game_type_cd == 'freezetag':
133         <td>${pgstat.kills}</td>
134         <td>${pgstat.deaths}</td>
135         <td>${pgstat.suicides}</td>
136 % endif
137 </%def>