{% extends shell('app') %} {% set heading = _('Edit account') if user else _('New account') %} {% block title %}{{ heading }} - {{ _('Admin') }}{% endblock %} {% block breadcrumb %} {% endblock %} {% block content %}

{{ heading }}{% if user %} {{ user.email }}{% endif %}

{% with messages = get_flashed_messages(with_categories=true) %} {% for category, message in messages %} {% endfor %} {% endwith %}
{{ form.hidden_tag() }}
{{ form.email.label(class="form-label fw-semibold") }} {{ form.email(class="form-control", autocomplete="off") }} {% for error in form.email.errors %}
{{ error }}
{% endfor %}
{{ form.role.label(class="form-label fw-semibold") }} {{ form.role(class="form-select") }} {% for error in form.role.errors %}
{{ error }}
{% endfor %}
{{ _('Administrators manage the whole panel, staff edit content, users only read what is published.') }}
{% if user %}
{{ form.new_password.label(class="form-label fw-semibold") }} {{ form.new_password(class="form-control", autocomplete="new-password") }}
{{ form.new_password.description }}
{% for error in form.new_password.errors %}
{{ error }}
{% endfor %}
{% else %}
{{ form.password.label(class="form-label fw-semibold") }} {{ form.password(class="form-control", autocomplete="new-password") }} {% for error in form.password.errors %}
{{ error }}
{% endfor %}
{% endif %} {# Only when the product sets AUTH_PASSWORD_CONFIRM (the form drops the field otherwise). #} {% if form.confirm_password %}
{{ form.confirm_password.label(class="form-label fw-semibold") }} {{ form.confirm_password(class="form-control", autocomplete="new-password") }} {% for error in form.confirm_password.errors %}
{{ error }}
{% endfor %}
{% endif %}
{{ form.active(class="form-check-input") }} {{ form.active.label(class="form-check-label") }}
{{ _('An inactive account cannot log in and its open sessions end.') }}
{# Edit only: an account the panel creates has its address vouched for by whoever creates it. #} {% if form.email_verified %}
{{ form.email_verified(class="form-check-input") }} {{ form.email_verified.label(class="form-check-label") }}
{{ _('Where addresses are confirmed, an account whose address is not confirmed cannot log in. Tick it when you know the address is theirs.') }}
{% endif %}
{{ form.service_account(class="form-check-input") }} {{ form.service_account.label(class="form-check-label") }}
{{ _('A program signs in with it (a marketplace, a CI job), not a person. Other features may spare it what would cut the program off, such as revoking its API tokens when its password changes or it is switched off.') }}
{{ form.submit(class="btn btn-primary") }} {{ _('Cancel') }}
{% endblock %}