Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

Commit

Permalink
Fix legends for matrices with no data
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Oct 19, 2023
1 parent c94a603 commit a383e7d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions core/templates/snippets/risk_matrix.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@
<div class="w-full">
<div class="flex flex-row justify-center">
<div class="text-black font-bold text-center print-impact flex items-center">
<p class="-rotate-90">{% trans "Impact" %}</p>
<p class="-rotate-90">{% trans "Probability" %}</p>
</div>
<table class="w-3/4 mt-10">
{% for row in matrix.render_grid_as_colors reversed %}
{% with row_index=forloop.revcounter0 %}
<tr>
<td class="w-1/6 text-center text-black bg-gray-200 border-4 border-white pr-2">
{% with impact=matrix.parse_json.impact|index:row_index %}
{{ impact.name }}:
{{ impact.description|linebreaksbr }}
{% with probability=matrix.parse_json.probability|index:row_index %}
{{ probability.name }}:
{{ probability.description|linebreaksbr }}
{% endwith %}
</td>
{% if enriched_data %}
Expand All @@ -70,17 +70,17 @@
{% endfor %}
<tr>
<td></td>
{% for probability in matrix.parse_json.probability %}
{% for impact in matrix.parse_json.impact %}
<td class="w-1/6 h-16 text-center text-black bg-gray-200 border-4 border-white">
{{ probability.name }}:
{{ probability.description|linebreaksbr }}
{{ impact.name }}:
{{ impact.description|linebreaksbr }}
</td>
{% endfor %}
</tr>
</table>
</div>
<div class="text-black font-bold text-center mx-auto mt-4">
{% trans "Probability" %}
{% trans "Impact" %}
</div>
</div>
<div class="w-full flex flex-col justify-start">
Expand Down

0 comments on commit a383e7d

Please sign in to comment.