{% load i18n %}
{% load ooi_extra %}

{% spaceless %}
  <div class="column-2">
    <div>
      <h2>{% translate 'Findings' %}</h2>
      <p>
        {% translate 'Overview of the number of findings found on' %} {{ ooi.get_ooi_type }} "{{ ooi.human_readable }}" {% translate 'and their severity.' %}
      </p>
      <p>
        {% translate 'Findings can occur multiple times. To give better insight the following table shows the number of unique findings found as well as the number of occurences.' %}
      </p>
      <a href="{% ooi_url 'ooi_findings' ooi.primary_key query=mandatory_fields %}"
         class="button">{% translate 'See finding details' %}</a>
    </div>
    <div class="horizontal-scroll">
      <table>
        <thead>
          <th>{% translate 'Severity' %}</th>
          <th>{% translate 'Occurences' %}</th>
        </thead>
        <tbody>
          {% for severity in severity_summary %}
            <tr>
              <td>
                <span class="{{ severity.risk_level }}">{{ severity.risk_level }}</span>
              </td>
              <td>{{ severity.occurences }}</td>
            </tr>
          {% endfor %}
        </tbody>
        <tfoot>
          <th>{% translate 'Total findings:' %}</th>
          <th>{{ severity_summary_totals.total_occurences }}</th>
        </tfoot>
      </table>
    </div>
  </div>
{% endspaceless %}
