{% load pygments_highlights %}
{% load datetime_formatting %}
{% load diff_result %}

{% for result in results %}
  {% with index=forloop.counter %}
    <h4 id="result_{{ index }}"><strong>Result #{{ index }}</strong></h4>
    <table class="table table-sm table-hover">
      <thead>
      <tr role="row">
        <th>Field</th>
        <th>Value</th>
      </tr>
      </thead>
      <tbody>
      {% for field, value in result.items %}
        <tr>
          <td id="{{ field }}_{{ index }}">
            <a href="#{{ field }}_{{ index }}">{{ field }}</a>
          </td>
          <td>
            {% if field == "diff" %}
              {{ value | diff_result | format_data | safe }}
            {% else %}
              {{ value | format_data | safe }}
            {% endif %}
          </td>
        </tr>
      {% endfor %}
      </tbody>
    </table>
    {% if not forloop.last %}
      <br>
      <hr>
      <br>
    {% endif %}
  {% endwith %}
{% endfor %}
