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