{% extends "base_template.html" %} {% block title %}{{ _('Users') }} - {{ _('Admin') }}{% endblock %} {% block breadcrumb %} {% endblock %} {% block content %}

{{ _('Users') }}

+ {{ _('New account') }}
{% with messages = get_flashed_messages(with_categories=true) %} {% for category, message in messages %} {% endfor %} {% endwith %} {% if users %}
{# Pinned to the right in the panel (admin's panel.css), so Edit and Delete stay in view on a phone. #} {% for user in users %} {% endfor %}
{{ _('Email') }} {{ _('Role') }} {{ _('Status') }} {{ _('Created') }}{{ _('Actions') }}
{{ user.email or '' }}{% if user.id == current_user.id %} {{ _('you') }}{% endif %} {% if user.role == 'admin' %}{{ _('Administrator') }} {% elif user.role == 'staff' %}{{ _('Staff') }} {% elif user.role == 'user' %}{{ _('User') }} {# A role the vocabulary does not know, written by an earlier set-role or by hand. Spelled as stored, so it is not mistaken for a plain user. #} {% else %}{{ user.role }}{% endif %} {% if user.active %}{{ _('Active') }} {% else %}{{ _('Inactive') }}{% endif %} {{ user.created_at.strftime('%Y-%m-%d') if user.created_at else '' }} {{ _('Edit') }} {% if user.id != current_user.id %} {# Deactivating is the usual answer and lives on the edit screen; this is for the account created by mistake. The address is the account holder's own text, so it reaches the script as plain text (striptags undoes the HTML escaping) turned into JSON, in a single quoted attribute no quote in it can leave. #}
{{ confirm_form.hidden_tag() }}
{% endif %}
{% else %}
{{ _('There are no accounts yet.') }} {{ _('Create the first one.') }}
{% endif %} {% endblock %}