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