{% extends "admin/change_list.html" %}
{% load i18n admin_list tours %}

{% block filters %}
  {% if cl.has_filters %}
    <div id="changelist-filter">
      <h2>{% translate 'Statistic' %}</h2>  
        {% for column, label in list_statistic %}
          {% calculate_total cl.result_list column as total %}
          {% if total is not None %}
            <h3>{{ label }}: {{ total }}</h3>
          {% endif %}
        {% endfor %}
      <h2>{% translate 'Filter' %}</h2>
      {% if cl.is_facets_optional or cl.has_active_filters %}
        <div id="changelist-filter-extra-actions">
          {% if cl.is_facets_optional %}
            <h3>
              {% if cl.add_facets %}
                <a href="{{ cl.remove_facet_link }}" class="hidelink">{% translate "Hide counts" %}</a>
              {% else %}
                <a href="{{ cl.add_facet_link }}" class="viewlink">{% translate "Show counts" %}</a>
              {% endif %}
            </h3>
          {% endif %}
          {% if cl.has_active_filters %}
            <h3>
              <a href="{{ cl.clear_all_filters_qs }}">&#10006; {% translate "Clear all filters" %}</a>
            </h3>
          {% endif %}
        </div>
      {% endif %}
      {% for spec in cl.filter_specs %}
        {% admin_list_filter cl spec %}
      {% endfor %}
    </div>
  {% endif %}
{% endblock %}
