{% load i18n %}

<tr>
  <th>{{ domain }}</th>
  {% if forloop.first %}
  <th class="text-center">{% trans "Total" %}</th>
  <th class="text-center">SPF</th>
  <th class="text-center">DKIM</th>
  {% else %}
  <th colspan="3"></th>
  {% endif %}
</tr>

{% for ip_address, results in stats.items %}
  <tr>
    <td class="col-sm-6">{{ ip_address }}</td>
    <td class="col-sm-2 text-center">{{ results.total }}</td>
    <td class="col-sm-2 text-center">
      {% if not only_failed %}<span class="label label-success">{{ results.spf.pass }}</span>{% endif %}
      <span class="label label-danger">{{ results.spf.fail }}</span>
    </td>
    <td class="col-sm-2 text-center">
      {% if not only_failed %}<span class="label label-success">{{ results.dkim.pass }}</span>{% endif %}
      <span class="label label-danger">{{ results.dkim.fail }}</span>
    </td>
  </tr>
{% endfor %}
