Applied Xonotic HTML/CSS/JS theme and worked existing HTML/CSS
[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':
36     <thead>
37                 <tr>
38                         <th>Nick</th>
39                         <th>Kills</th>
40                         <th>Deaths</th>
41                         <th>Suicides</th>
42                         <th>Score</th>
43                         <th>Accuracy</th>
44                 </tr>
45     </thead>
46 % endif
47
48 % if game_type_cd == 'ctf':
49     <thead class="${pgstat.team_html_color()}">
50                 <tr>
51                         <th>Nick</th>
52                         <th>Kills</th>
53                         <th>Captures</th>
54                         <th>Pickups</th>
55                         <th>Flag Carrier Kills</th>
56                         <th>Returns</th>
57                         <th>Score</th>
58                         <th>Accuracy</th>
59                 </tr>
60     </thead>
61 % endif
62
63 % if game_type_cd == 'ca':
64     <thead class="${pgstat.team_html_color()}">
65                 <tr>
66                         <th>Nick</th>
67                         <th>Kills</th>
68                         <th>Score</th>
69                         <th>Accuracy</th>
70                 </tr>
71     </thead>
72 % endif
73
74 % if game_type_cd == 'freezetag':
75     <thead class="${pgstat.team_html_color()}">
76                 <tr>
77                         <th>Nick</th>
78                         <th>Kills</th>
79                         <th>Deaths</th>
80                         <th>Suicides</th>
81                         <th>Score</th>
82                         <th>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':
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>