]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/frag_matrix.mako
Remove more refs to sqlahelper.
[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 class="text-center"><i class="fa fa-question-circle" title="The rows are the fraggers, the columns are the victims"></i></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         % if fragger.player_game_stat_id == victim.player_game_stat_id:
18             <td class="bg"></td>
19         % else:
20           <%
21             pgfm = matrix_by_pgstat_id.get(fragger.player_game_stat_id)
22   
23             victim_pgfm = matrix_by_pgstat_id.get(victim.player_game_stat_id)
24             if victim_pgfm:
25               victim_index = str(victim_pgfm.player_index)
26             else:
27               victim_index = "-1"
28           %>
29   
30           % if pgfm:
31             <td>${pgfm.matrix.get(victim_index, 0)}</td>
32           % else:
33             <td>0</td>
34           % endif
35         % endif
36       % endfor
37     </tr>
38   % endfor
39 </table>
40
41 </%def>