{% load admin_interface_tags i18n %}

{% get_admin_interface_theme as theme %}

{% if theme.list_filter_dropdown %}

    {% include "admin_interface/dropdown_filter.html" %}

{% else %}

    {# Use a changed default list filter template -> https://github.com/django/django/blob/master/django/contrib/admin/templates/admin/filter.html #}

    <details data-filter-title="{{ title }}" open>
        <summary {% if spec.lookup_val or spec.value %}class="active"{% endif %}>
            {% blocktranslate with filter_title=title %} By {{ filter_title }} {% endblocktranslate %}
        </summary>
        <ul {% if spec.lookup_val or spec.value %}class="active"{% endif %}>
            {% for choice in choices %}
            <li{% if choice.selected %} class="selected"{% endif %}>
            <a href="{{ choice.query_string|iriencode }}">{{ choice.display }}</a></li>
            {% endfor %}
        </ul>
    </details>

{% endif %}
