{% load i18n wagtailadmin_tags %}
{% if media_files %}
    {% if is_searching %}
        <h2 role="alert">
            {% blocktrans trimmed count counter=media_files|length %}
                There is {{ counter }} match
            {% plural %}
                There are {{ counter }} matches
            {% endblocktrans %}
        </h2>

        {% search_other %}
    {% endif %}

    {% include "wagtailmedia/media/list.html" %}

    {% include "wagtailadmin/shared/pagination_nav.html" with items=media_files is_searching=is_searching linkurl="wagtailmedia:index" %}
{% else %}
    {% if is_searching %}
         <h2 role="alert">{% blocktrans %}Sorry, no media files match "<em>{{ query_string }}</em>"{% endblocktrans %}</h2>

         {% search_other %}
    {% else %}
        {% url 'wagtailmedia:add' 'audio' as wagtailmedia_add_audio_url %}
        {% url 'wagtailmedia:add' 'video' as wagtailmedia_add_video_url %}
        {% if current_collection %}
            <p>{% blocktrans %}You haven't uploaded any media files in this collection. You can upload <a href="{{ wagtailmedia_add_audio_url }}">audio</a> or <a href="{{ wagtailmedia_add_video_url }}">video</a> files.{% endblocktrans %}</p>
        {% else %}
            <p>{% blocktrans %}You haven't uploaded any media files. You can upload <a href="{{ wagtailmedia_add_audio_url }}">audio</a> or <a href="{{ wagtailmedia_add_video_url }}">video</a> files.{% endblocktrans %}</p>
        {% endif %}
    {% endif %}
{% endif %}
