]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/frag_matrix.mako
Add styles to make the headers vertical.
[xonotic/xonstat.git] / xonstat / templates / frag_matrix.mako
1 <%def name="frag_matrix(pgstats, matrix_by_pgstat_id)">
2
3 ## Displays a frag matrix table, in scoreboardpos order from top to bottom and left to right
4
5 <table>
6   <thead>
7     <th></th>
8     % for pgstat in pgstats:
9     <th><span class="rotated">${pgstat.nick_html_colors()|n}</span></th>
10     % endfor
11   </thead>
12
13   % for fragger in pgstats:
14   <tr>
15     <td class="bg">${fragger.nick_html_colors()|n}</td>
16     % for victim in pgstats:
17     <%
18       pgfm = matrix_by_pgstat_id.get(fragger.player_game_stat_id)
19
20       victim_pgfm = matrix_by_pgstat_id.get(victim.player_game_stat_id)
21       if victim_pgfm:
22         victim_index = str(victim_pgfm.player_index)
23       else:
24         victim_index = "-1"
25     %>
26     <td>${pgfm.matrix.get(victim_index, 0)}</td>
27     % endfor
28   </tr>
29   % endfor
30 </table>
31
32 </%def>