{% extends 'syspanel/base.html' %}
{% load i18n %}
{% block title %}Users{% endblock %}

{% block page_header %}
  {% url horizon:syspanel:users:index as refresh_link %}
  {# to make searchable false, just remove it from the include statement #}
  {% include "horizon/common/_page_header.html" with title=_("Users") refresh_link=refresh_link searchable="true" %}
{% endblock page_header %}

{% block syspanel_main %}

    <table class="zebra-striped">
      <tr>
        <th>{% trans "ID" %}</th>
        <th>{% trans "Name" %}</th>
        <th>{% trans "Email" %}</th>
        <th>{% trans "Default Tenant" %}</th>
        <th>{% trans "Options" %}</th>
      </tr>
      {% for user in users %}
        <tr class="{% cycle 'odd' 'even' %}">
          <td>{{ user.id }}{% if not user.enabled %} (disabled){% endif %}</td>
          <td>{{ user.name }}</td>
          <td>{{ user.email }}</td>
          <td>{{ user.tenantId }}</td>
          <td id="actions">
            <ul>
              <li><a class="btn small" href="{% url horizon:syspanel:users:update user.id %}">{% trans "Edit" %}</a></li>
              <li class="form">{% include "syspanel/users/_enable_disable.html" with form=user_enable_disable_form %}</li>
              <li class="form">{% include "syspanel/users/_delete.html" with form=user_delete_form %}</li>
            </ul>
          </td>
        </tr>
      {% endfor %}
    </table>
    <a id="user_create_link" class="btn small" href="{% url horizon:syspanel:users:create %}">{% trans "Create New User" %}</a>
  </div>

{% endblock %}
