]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/scoreboard.mako
ec3a20c4e362d448491541181a29e9ac0fd8b03f
[xonotic/xonstat.git] / xonstat / templates / scoreboard.mako
1 <%def name="scoreboard(game_type_cd, pgstats)">
2 <table class="scoreboard" border="1" cellpadding="3">
3 ${scoreboard_header(game_type_cd, pgstats[0])}
4 % for pgstat in pgstats:
5     <tr style="background-color:${pgstat.team_html_color()}">
6         <td>
7         % if pgstat.player_id > 2:
8           <a href="${request.route_url("player_info", id=pgstat.player_id)}"
9            title="Go to the info page for this player">
10           <span class="nick">${pgstat.nick_html_colors()|n}</span>
11           </a>
12         % else:
13           <span class="nick">${pgstat.nick_html_colors()|n}</span>
14         % endif
15         </td>
16         ${scoreboard_row(game_type_cd, pgstat)}
17         <td><span style="color:#FFFF00;">${pgstat.score}</span></td>
18         <td>
19         % if pgstat.player_id > 1:
20           <a href="${request.route_url("game_info", id=pgstat.game_id)}#accuracy-${pgstat.player_game_stat_id}"
21            title="View weapon accuracy details for this player in this game">
22           View
23           </a>
24         % endif
25         </td>
26     </tr>
27 % endfor
28 </table>
29 </%def>
30
31 ##### SCOREBOARD HEADER #####
32 <%def name="scoreboard_header(game_type_cd, pgstat)">
33 % if game_type_cd == 'dm' or game_type_cd == 'tdm':
34     <tr class="table-header" style="color:black;}">
35         <th>Nick</th>
36         <th>Kills</th>
37         <th>Deaths</th>
38         <th>Suicides</th>
39         <th>Score</th>
40         <th>Accuracy</th>
41     </tr>
42 % endif
43
44 % if game_type_cd == 'ctf':
45     <tr class="table-header" style="color:${pgstat.team_html_color()}">
46         <th>Nick</th>
47         <th>Kills</th>
48         <th>Captures</th>
49         <th>Pickups</th>
50         <th>Flag Carrier Kills</th>
51         <th>Returns</th>
52         <th>Score</th>
53         <th>Accuracy</th>
54     </tr>
55 % endif
56
57 % if game_type_cd == 'ca':
58     <tr class="table-header" style="color:${pgstat.team_html_color()}">
59         <th>Nick</th>
60         <th>Kills</th>
61         <th>Score</th>
62         <th>Accuracy</th>
63     </tr>
64 % endif
65
66 % if game_type_cd == 'freezetag':
67     <tr style="color:${pgstat.team_html_color()}">
68         <th>Nick</th>
69         <th>Kills</th>
70         <th>Deaths</th>
71         <th>Suicides</th>
72         <th>Score</th>
73         <th>Accuracy</th>
74     </tr>
75 % endif
76 </%def>
77
78 ##### SCOREBOARD ROWS #####
79 <%def name="scoreboard_row(game_type_cd, pgstat)">
80 % if game_type_cd == 'dm' or game_type_cd == 'tdm':
81         <td>${pgstat.kills}</td>
82         <td>${pgstat.deaths}</td>
83         <td>${pgstat.suicides}</td>
84 % endif
85
86 % if game_type_cd == 'ctf':
87         <td>${pgstat.kills}</td>
88         <td>${pgstat.captures}</td>
89         <td>${pgstat.pickups}</td>
90         <td>${pgstat.carrier_frags}</td>
91         <td>${pgstat.returns}</td>
92 % endif
93
94 % if game_type_cd == 'ca':
95         <td>${pgstat.kills}</td>
96 % endif
97
98 % if game_type_cd == 'freezetag':
99         <td>${pgstat.kills}</td>
100         <td>${pgstat.deaths}</td>
101         <td>${pgstat.suicides}</td>
102 % endif
103 </%def>