{#- One account, or a new one: who it is, what it does and where, what it may do (sign in at all, run the site) and its password; beside it, its communities and its last sign-ins. Signing in as the person is in sight. Overrides Abilian Core's page; drawn in `mockups/templates/admin-user.html`. -#} {% extends "admin/_ads.html" %} {% import "admin/_ads_macros.html" as a with context %} {% import "forum/_post_fields.html" as fields %} {% set user = view.obj %} {% set creating = not user.id %} {% block page_title %}{{ _("New account") if creating else user.name }} · {{ _("Accounts") }} · {{ _("Administration") }}{% endblock %} {% block heading %}{% if creating %}{{ _("New account") }}{% else %}{{ m.avatar(user) }}{{ user.name }}{{ a.state(user) }}{% endif %}{% endblock %} {% block actions %}{% if not creating and user.can_login and user != current_user %}{{ a.sign_in_as(user) }}{% endif %}{% endblock %} {#- A field, with what it says under it only when that helps: not Core's "ex: John". -#} {% macro input(field, type="text", label=none, autocomplete=none, help=false) %} {% set described = ([field.id ~ "-help"] if help else []) + ([field.id ~ "-error"] if field.errors else []) %}
{% if help %}{{ field.description }}{% endif %} {{ fields.errors(field) }}
{% endmacro %} {% block content %}
{{ form.csrf_token }}

{{ _("The account") }}

{{ input(form.first_name, label=_("First name"), autocomplete="off") }} {{ input(form.last_name, label=_("Last name"), autocomplete="off") }} {{ input(form.job_title, label=_("Job title"), autocomplete="off") }} {{ input(form.organization, label=_("Organization"), autocomplete="off") }}
{{ input(form.email, "email", _("Email address"), "off", help=true) }} {% for value, label in form.roles.choices %} {% endfor %}
{{ input(form.password, "password", _("Password") if creating else _("New password"), "new-password", help=true) }} {% if form.confirm_password %}{{ input(form.confirm_password, "password", _("The new password again"), "new-password") }}{% endif %}
{{ _("Cancel") }}
{% if not creating %} {% endif %}
{% endblock %}