{% load i18n wagtailadmin_tags %}

{% if results %}
    {% if is_searching %}
        {% block search_results_count %}
            <h2 role="alert">
                {% with result_count=results.paginator.count %}
                    {% blocktrans trimmed with counter=result_count|intcomma count counter_val=result_count %}
                        There is {{ counter }} match
                    {% plural %}
                        There are {{ counter }} matches
                    {% endblocktrans %}
                {% endwith %}
            </h2>
        {% endblock %}
    {% else %}
        {% block listing_title %}{% endblock %}
    {% endif %}

    {% block results_listing %}
        {% component table %}
    {% endblock %}
    {% include "wagtailadmin/shared/pagination_nav.html" with items=results linkurl=results_pagination_url %}
{% else %}
    {% if is_searching %}
        {% block no_search_results_message %}
            <p role="alert">{% blocktrans trimmed %}Sorry, there are no matches for "<em>{{ search_query }}</em>"{% endblocktrans %}</p>
        {% endblock %}
    {% else %}
        {% block no_items_message %}
            <p>{% trans "There are no results." %}</p>
        {% endblock %}
    {% endif %}
{% endif %}
