{% load wagtailadmin_tags %}
{% load i18n %}
{% if videos %}
    {% if is_searching %}
        <h2>
        {% blocktrans count counter=videos.paginator.count %}
            There is one match
        {% plural %}
            There are {{ counter }} matches
        {% endblocktrans %}
        </h2>
    {% else %}
        <h2>{% trans "Latest videos" %}</h2>
    {% endif %}

    <ul class="listing horiz images chooser">
        {% for video in videos %}
            <li>
                <a class="image-choice" href="{% if will_select_format %}{% url 'wagtailvideos:chooser_select_format' video.id %}{% else %}{% url 'wagtailvideos:video_chosen' video.id %}{% endif %}">
                    <div class="image">
                        {% if video.thumbnail %}
                        <img src='{{video.thumbnail.url}}' width="165" height="165" class="show-transparency">
                        {% else %}
                        <img width="165" height="165" class="show-transparency">
                        {% endif %}
                    </div>
                    <h3>{{ video.title|ellipsistrim:60 }}</h3>
                </a>
            </li>
        {% endfor %}
    </ul>

    {% include "wagtailadmin/shared/pagination_nav.html" with items=videos is_ajax=1 %}
{% endif %}
