]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/scoreboard.mako
dos2unix file conversions for everything
[xonotic/xonstat.git] / xonstat / templates / scoreboard.mako
1 <%def name="scoreboard(game_type_cd, pgstats)">
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     ${scoreboard_row(game_type_cd, pgstat)}
18       <td>${pgstat.score}</td>
19     </tr>
20   % endfor
21   </tbody>
22 </table>
23 </%def>
24
25 ##### SCOREBOARD HEADER #####
26 <%def name="scoreboard_header(game_type_cd, pgstat)">
27 % if game_type_cd == 'dm' or game_type_cd == 'tdm' or game_type_cd == 'duel':
28     <thead>
29     <tr>
30       <th class="nick">Nick</th>
31       <th class="kills">Kills</th>
32       <th class="deaths">Deaths</th>
33       <th class="suicides">Suicides</th>
34       <th class="score">Score</th>
35     </tr>
36     </thead>
37 % endif
38
39 % if game_type_cd == 'ctf':
40     <thead class="ctf ${pgstat.team_html_color()}">
41     <tr>
42       <th class="nick">Nick</th>
43       <th class="kills">Kills</th>
44       <th class="captures">Captures</th>
45       <th class="pickups">Pickups</th>
46       <th class="fck" title="Flag Carrier Kill">FCK</th>
47       <th class="returns">Returns</th>
48       <th class="score">Score</th>
49     </tr>
50     </thead>
51 % endif
52
53 % if game_type_cd == 'ca':
54     <thead class="ca ${pgstat.team_html_color()}">
55     <tr>
56       <th class="nick">Nick</th>
57       <th class="kills">Kills</th>
58       <th class="score">Score</th>
59     </tr>
60     </thead>
61 % endif
62
63 % if game_type_cd == 'freezetag':
64     <thead class="freezetag ${pgstat.team_html_color()}">
65     <tr>
66       <th class="nick">Nick</th>
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     </tr>
72     </thead>
73 % endif
74 </%def>
75
76 ##### SCOREBOARD ROWS #####
77 <%def name="scoreboard_row(game_type_cd, pgstat)">
78 % if game_type_cd == 'dm' or game_type_cd == 'tdm' or game_type_cd == 'duel':
79         <td>${pgstat.kills}</td>
80         <td>${pgstat.deaths}</td>
81         <td>${pgstat.suicides}</td>
82 % endif
83
84 % if game_type_cd == 'ctf':
85         <td>${pgstat.kills}</td>
86         <td>${pgstat.captures}</td>
87         <td>${pgstat.pickups}</td>
88         <td>${pgstat.carrier_frags}</td>
89         <td>${pgstat.returns}</td>
90 % endif
91
92 % if game_type_cd == 'ca':
93         <td>${pgstat.kills}</td>
94 % endif
95
96 % if game_type_cd == 'freezetag':
97         <td>${pgstat.kills}</td>
98         <td>${pgstat.deaths}</td>
99         <td>${pgstat.suicides}</td>
100 % endif
101 </%def>