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

        {% search_other %}
    {% endif %}

    {% include "wagtailusers/users/list.html" %}

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

         {% search_other %}
    {% else %}
        {% url 'wagtailusers_users:add' as wagtailusers_add_url %}
        {% if group %}
            {% with group.name as group_name %}
                <p>{% blocktrans %}The {{ group_name }} group has no users configured. Why not <a href="{{ wagtailusers_add_url }}">add some</a>?{% endblocktrans %}</p>
            {% endwith %}
        {% else %}
            <p>{% blocktrans %}There are no users configured. Why not <a href="{{ wagtailusers_add_url }}">add some</a>?{% endblocktrans %}</p>
        {% endif %}
    {% endif %}
{% endif %}
