{% extends "vault/base.html" %}
{% load i18n %}
{% load pagination %}

{% block title %}{% trans 'Users' %}{% endblock %}

{% block content_title %}Identity{% endblock %}

{% block breadcrumb %}{% trans 'Users' %}{% endblock %}

{% block content_top %}
  <a href="{% url 'admin_add_user' project=project_name %}" class="create-user btn btn-primary btn-sm">
    <i class="fa fa-user icon-white"></i>&nbsp;&nbsp;{% trans 'Create User' %}
  </a>
{% endblock %}

{% block content %}
<div class="box">
  <table class="items-list table table-hover">
    <thead>
      <tr>
        <th width="40%">{% trans 'User' %}</th>
        <th width="45%">{% trans 'Email' %}</th>
        <th width="10%">{% trans 'Enabled' %}</th>
        <th width="5%"></th>
      </tr>
    </thead>
    <tbody>
      {% for user in users %}
      <tr>
        <td>{{ user.name }}</td>
        <td>{{ user.email }}</td>
        <td>{{ user.enabled }}</td>
        <td>
          <a href="{% url 'edit_user' project=project_name user_id=user.id %}" class="edit-item btn btn-light btn-sm">{% trans 'Edit' %}</a>
        </td>
      </tr>
      {% endfor %}
    </tbody>
  </table>
</div>
{% pagination users %}
{% endblock %}

{% block js_bottom %}
{{ block.super }}
<script>
  Base.Paginator.init();
</script>
{% endblock %}
