{% load i18n wagtailadmin_tags %}
<div class="nice-padding">
    {% if pages %}
        <h2 role="alert">
            {% blocktrans trimmed count counter=all_pages.count %}
                There is one matching page
            {% plural %}
                There are {{ counter }} matching pages
            {% endblocktrans %}
        </h2>

        {% search_other %}

        {% if object_list.supports_facet %}
            <nav class="listing-filter" aria-labelledby="page-types-title">
                <h3 id="page-types-title" class="filter-title">{% trans "Page types" %}</h3>
                <ul class="filter-options">
                    {% if not selected_content_type %}
                        <li class="w-bg-border-furniture">{% trans "All" %} ({{ all_pages.count }})</li>
                    {% else %}
                        <li><a href="{% url 'wagtailadmin_pages:search' %}?q={{ query_string|urlencode }}">{% trans "All" %} ({{ all_pages.count }})</a></li>
                    {% endif %}

                    {% for content_type, count in content_types %}
                        {% if content_type == selected_content_type %}
                            <li class="w-bg-border-furniture">{{ content_type.model_class.get_verbose_name }} ({{ count }})</li>
                        {% else %}
                            <li><a href="{% url 'wagtailadmin_pages:search' %}?q={{ query_string|urlencode }}&amp;content_type={{ content_type.app_label }}.{{ content_type.model|lower }}">{{ content_type.model_class.get_verbose_name }} ({{ count }})</a></li>
                        {% endif %}
                    {% endfor %}
                </ul>
            </nav>
        {% endif %}

        {% component table %}

        {% if is_paginated %}
            {% include "wagtailadmin/shared/pagination_nav.html" with items=page_obj linkurl=index_url %}
        {% endif %}
    {% else %}
        {% if query_string %}
            <h2 role="alert">{% blocktrans trimmed %}Sorry, no pages match <em>{{ query_string }}</em>{% endblocktrans %}</h2>

            {% search_other %}
        {% else %}
            <p>{% trans 'Enter a search term above' %}</p>
        {% endif %}
    {% endif %}
</div>
