{% load i18n %}
{% load gravatar %}
<table class="listing">
    <thead>
        <tr>
            <th class="name">
                {% trans "Name" %}
                {% if ordering == "name" %}
                    <a href="{% url 'wagtailusers_users:index' %}" class="icon icon-arrow-down-after teal"></a>
                {% else %}
                    <a href="{% url 'wagtailusers_users:index' %}?ordering=name" class="icon icon-arrow-down-after"></a>
                {% endif %}
            </th>
            <th class="username">
                {% trans "Username" %}
                {% if ordering == "username" %}
                    <a href="{% url 'wagtailusers_users:index' %}" class="icon icon-arrow-down-after teal"></a>
                {% else %}
                    <a href="{% url 'wagtailusers_users:index' %}?ordering=username" class="icon icon-arrow-down-after"></a>
                {% endif %}
            </th>
            <th class="level">{% trans "Level" %}</th>
            <th class="status">{% trans "Status" %}</th>
        </tr>
    </thead>
    <tbody>
        {% for user in users %}
            <tr>
                <td class="title">
                    <h2>
                        <span class="avatar small icon icon-user"><img src="{% gravatar_url user.email 25 %}" /></span>
                        <a href="{% url 'wagtailusers_users:edit' user.id %}">{{ user.get_full_name|default:user.get_username }}</a>
                    </h2>
                </td>
                <td class="username">{{ user.get_username }}</td>
                <td class="level">{% if user.is_superuser %}{% trans "Admin" %}{% endif %}</td>
                <td class="status"><div class="status-tag {% if user.is_active %}primary{% endif %}">{% if user.is_active %}{% trans "Active" %}{% else %}{% trans "Inactive" %}{% endif %}</div></td>
            </tr>
        {% endfor %}
    </tbody>
</table>
