Skip to content

Commit cec75e9

Browse files
authored
Only show compliance issues if any are present in report (#2165)
1 parent 4466e35 commit cec75e9

1 file changed

Lines changed: 21 additions & 19 deletions

File tree

rocky/reports/report_types/aggregate_organisation_report/system_specific.html

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,27 @@ <h4>{{ type }}</h4>
4444
</table>
4545
</div>
4646
{% for ip, findings in data.ips.items %}
47-
<h5>{{ ip }}</h5>
48-
<table>
49-
<thead>
50-
<tr>
51-
<th>{% translate "Compliance issue" %}</th>
52-
<th>{% translate "Risk level" %}</th>
53-
</tr>
54-
</thead>
55-
<tbody>
56-
{% for finding_type in findings %}
47+
{% if findings %}
48+
<h5>{{ ip }}</h5>
49+
<table>
50+
<thead>
5751
<tr>
58-
<td>
59-
<span class="icon negative"></span>{{ finding_type.description }}
60-
</td>
61-
<td>
62-
<span class="{{ finding_type.risk_severity }}">{{ finding_type.risk_severity|capfirst }}</span>
63-
</td>
52+
<th>{% translate "Compliance issue" %}</th>
53+
<th>{% translate "Risk level" %}</th>
6454
</tr>
65-
{% endfor %}
66-
</tbody>
67-
</table>
55+
</thead>
56+
<tbody>
57+
{% for finding_type in findings %}
58+
<tr>
59+
<td>
60+
<span class="icon negative"></span>{{ finding_type.description }}
61+
</td>
62+
<td>
63+
<span class="{{ finding_type.risk_severity }}">{{ finding_type.risk_severity|capfirst }}</span>
64+
</td>
65+
</tr>
66+
{% endfor %}
67+
</tbody>
68+
</table>
69+
{% endif %}
6870
{% endfor %}

0 commit comments

Comments
 (0)