{% import "macros.html.j2" as macros %}
<h2>Users</h2>
{% with users = ctx.db.list_users(uid=ctx.uid) %}
{% for user in users %}
<div class="user row u-flex">
  <div class="details six columns">
    <span class="user-name">{{ user.name }}</span>
    <span class="user-email">{{ user.email }}</span>
    <span class="user-group">{{ user.group }}</span>
    <span class="user-status">{{ user.status }}</span>
  </div>
  <div class="controls u-flex u-ml-auto">
    {% if not user.approved_at %}{{ macros.approve_user(user.id) }}{% endif %}
    {% if not user.enabled_at %}
      {{ macros.enable_user(user.id) }}
    {% else %}
      {{ macros.lock_user(user.id) }}
    {% endif %}
    {{ macros.passwdchng_user(user.id) }}
  </div>
</div>
{% endfor %}
{% endwith %}
