{% load admin_urls %}
{% load i18n admin_list dashub %}

<form method="get" class="offcanvas offcanvas-end" tabindex="-1" id="filtersOffcanvas"
      aria-labelledby="filtersOffcanvasLabel">
    <div class="offcanvas-header">
        <h5 class="offcanvas-title" id="filtersOffcanvasLabel">{% trans "Filter" %}</h5>
        <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="{% trans "Close" %}"></button>
    </div>

    <div class="offcanvas-body">
        {% if cl.model_admin.list_filter_submit %}
            {% preserve_filters %}
        {% endif %}

        {% for spec in cl.filter_specs %}
            {% admin_list_filter cl spec %}
        {% endfor %}
    </div>

    <div class="offcanvas-footer">
        <button type="submit" class="btn btn-primary btn-with-icon">
            <i class="hgi hgi-stroke hgi-filter"></i> {% trans "Apply Filter" %}
        </button>
        {% safe_admin_changelist_url cl.opts as changelist_url %}
        {% if changelist_url %}
            <a href="{{ changelist_url }}" class="btn btn-outline-secondary btn-with-icon mt-2">
                <i class="hgi hgi-stroke hgi-cancel-circle"></i> {% trans "Clear All Filter" %}
            </a>
        {% endif %}
    </div>
</form>
