{% extends "wagtailadmin/generic/chooser/chooser.html" %}

{% load i18n wagtailadmin_tags %}

{% block filter_form %}
    <form
        data-chooser-modal-search
        class="search-bar"
        action="{{ results_url }}"
        method="GET"
        autocomplete="off"
        novalidate
    >
        <ul class="fields">
            {% for field in filter_form %}
                {% include "wagtailadmin/shared/field_as_li.html" with field=field %}
            {% endfor %}
            {% if popular_tags %}
                <li class="taglist w-label-3">
                    <h3>{% trans 'Popular tags' %}</h3>
                    {% for tag in popular_tags %}
                        <a class="suggested-tag tag" href="{% url 'wagtailvideos:index' %}?tag={{ tag.name|urlencode }}">{{ tag.name }}</a>
                    {% endfor %}
                </li>
            {% endif %}
        </ul>
    </form>
{% endblock %}
