{% extends 'syspanel/base.html' %}
{% load i18n %}

{% block page_header %}
  <div class='page-header'>
    <h2>{% trans "Users for Tenant"%}: <span>{{tenant_id}}</span></h2>
  </div>
{% endblock %}

{% block syspanel_main %}
<div id="usage">

  {% if users %}
    <table class="zebra-striped">
      <tr id='headings'>
        <th>{% trans "ID"%}</th>
        <th>{% trans "Name"%}</th>
        <th>{% trans "Email"%}</th>
        <th>{% trans "Actions"%}</th>
      </tr>
      <tbody class='main'>
        {% for user in users %}
        <tr class="{% cycle 'odd' 'even' %}">
            <td>{{user.id}}</td>
            <td>{{user.name}}</td>
            <td>{{user.email}}</td>
            <td id="actions">
              <ul>
                <li class="form">{% include "syspanel/tenants/_remove_user.html" with form=remove_user_form %}</li>
              </ul>
            </td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
  {% else %}
    <div class="message_box info">
      <h2>{% trans "Info"%}</h2>
      <p>T{% trans "here are currently no users for this tenant"%}</p>
    </div>
  {% endif %}
  {% if new_users %}
    <h3>{% trans "Add new users"%}</h3>
    <table class="zebra-striped">
      <tr id='headings'>
        <th>{% trans "ID"%}</th>
        <th>{% trans "Name"%}</th>
        <th>{% trans "Actions"%}</th>
      </tr>
      <tbody class='main'>
        {% for user in new_users %}
        <tr class="{% cycle 'odd' 'even' %}">
            <td>{{user.id}}</td>
            <td>{{user.name}}</td>
            <td id="actions">
              <ul>
                <li class="form">{% include "syspanel/tenants/_add_user.html" with form=add_user_form %}</li>
              </ul>
            </td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
  {% endif %}

{% endblock %}
