{# Unified template for both Controls and Observations #}

{{ section_title }}

{# Overview Table Section #}
{{ section_title }} Overview
{% if section_id == 'controls' %} {% else %} {% endif %} {% for item in items %} {% if section_id == 'controls' %} {% else %} {% endif %} {% endfor %}
Name Severity ConfidenceStatus Total Occurrences OK KOTotal Occurrences
{{ item.name }} {{ item.max_severity }} {{ item.confidence }} {{ item.status }} {{ item.occurrences|length }} {{ item.total_status_ok }} {{ item.total_status_ko }}{{ item.occurrences|length }}
{# Detailed Items Section #} {% for item in items %}
{% if section_id == 'observations' %}
{{ item.name }} {{ item.max_severity }}
{% else %}
{{ item.name }} {{ item.max_severity }} {{ item.status }} {{ item.confidence }}
{% endif %}
{% if section_id == 'controls' %} {% endif %} {% for key in item.all_keys %} {% endfor %} {% for occurrence in item.occurrences %} {% if section_id == 'controls' %} {% endif %} {% for key in item.all_keys %} {% endfor %} {% endfor %}
Severity ConfidenceStatus{{ key }}
{{ occurrence.severity }} {{ occurrence.confidence }} {{ occurrence.status }} {{ occurrence.details.get(key, '') }}
{% endfor %}