{% extends 'admin/change_list.html' %}
{% load i18n admin_list suit_list%}

{% block search %}{% suit_search_form cl %}{% endblock %}

{% block object-tools %}
{# this block is copied in search_form.html to have the add button in the right div I case horizontal filter with a lot of filters #}
{% endblock %}

{% block filters %}
    {% if cl.has_filters %}
        <div id="changelist-filter">{% for spec in cl.filter_specs|suit_list_filter_vertical:cl %}
            {% if forloop.first %}
                <h2>{% trans 'Filter' %}</h2>
            {% endif %}
            {% admin_list_filter cl spec %}
        {% endfor %}</div>
    {% endif %}
{% endblock %}

{% block footer %}
    {{ block.super }}

    {% if cl.has_filters %}
        <script type="text/javascript">
            // Handle change list filter null values
            Suit.$('.search-filter').suitSearchFilters();
        </script>
    {% endif %}
{% endblock %}
