{% extends 'assets/base.html' %}
{% load cache i18n %}

{% block content %}
<h1>{{ report.name }}</h1>
  {% spaceless %}
  <div class="report">
    <div class="pagination">
      <ul>
        <li><a class="expand-all" href="#">{% trans 'Expand all' %}</a></li>
        <li><a class="collapse-all" href="#">{% trans 'Collapse all' %}</a></li>
      </ul>
    </div>
    {% if report.with_modes %}
      <div class="pagination">
        <ul>
          {% for report_mode in modes %}
            <li{% if mode == report_mode.name %} class="active"{% endif %}><a href="{% url report_detail report_mode.name slug %}">{{ report_mode.verbose_name }}</a></li>
          {% endfor %}
        </ul>
      </div>
    {% endif %}
    {% cache 3600 report cache_key %}
      <p>{% trans 'Last update:' %} {% now "SHORT_DATETIME_FORMAT" %}</p>
      <table class="table table-striped">
        <thead>
          <tr>
            <th>{% trans 'Info' %}</th>
            <th>{% trans 'Count' %}</th>
            {% if report.links %}
              <th>{% trans 'Link' %}</th>
            {% endif %}
          </tr>
        </thead>
        <tbody>
          {% for node in result %}
            {% with level=0 parent=0 %}
              {% include "assets/report_tree.html" %}
            {% endwith %}
          {% endfor %}
        </tbody>
      </table>
    {% endcache %}
  </div>
  {% endspaceless %}
{% endblock %}
