{% extends "app.html" %}
{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}

{% load bootstrap %}
{% load i18n %}

{% block configuration %}

  <h3>{% trans "Users" %}</h3>

  <div class="btn-toolbar">
    <a href="{% url 'users:create' %}" class="btn btn-primary"
       role="button" title="{% trans 'Create User' %}">
      <span class="fa fa-plus" aria-hidden="true"></span>
      {% trans 'Create User' %}
    </a>
  </div>

  <div class="row">
    <div class="col-md-6">
      <div class="list-group list-group-two-column">
        {% for user in object_list %}
          <div class="list-group-item">
            <a class='user-edit-label primary'
               href="{% url 'users:edit' user.username %}"
               title="{% blocktrans with username=user.username %}Edit user {{ username }}{% endblocktrans %}">
              {{ user.username }}
            </a>

            {% if not user.is_active %}
              <span class="fa fa-ban primary"
                    aria-hidden="true"></span>
            {% endif %}

            {% if user.username != last_admin_user %}
              <a href="{% url 'users:delete' user.username %}"
                 class="btn btn-default btn-sm secondary"
                 role="button"
                 title="{% blocktrans with username=user.username %}Delete user {{ username }}{% endblocktrans %}">
                <span class="fa fa-trash-o"
                      aria-hidden="true"></span>
              </a>
            {% endif %}
          </div>
        {% endfor %}
      </div>

    </div>
  </div>

{% endblock %}
