{% extends "base.html" %} {% block tab_title %}{{ gettext('Add User') }}{% endblock %} {% block body %} {{ gettext('Back to admin interface') }} Add User {{ form.password(value=password, id=False) }} {{ gettext('Username') }} {% set aria_attributes = {} %} {% if form.username.errors %} {% do aria_attributes.update({'aria-describedby': 'username-errors', 'aria-invalid': 'true'}) %} {% endif %} {{ form.username(**aria_attributes) }} {% for error in form.username.errors %} {{ error }} {% endfor %} {{gettext("Username can contain spaces")}} {{gettext("Username is case-sensitive")}} {{ gettext('First name') }} {% set aria_attributes = {} %} {% if form.first_name.errors %} {% do aria_attributes.update({'aria-describedby': 'first-name-errors', 'aria-invalid': 'true'}) %} {% endif %} {{ form.first_name(**aria_attributes) }} {% for error in form.first_name.errors %} {{ error }} {% endfor %} {{ gettext('Last name') }} {% set aria_attributes = {} %} {% if form.last_name.errors %} {% do aria_attributes.update({'aria-describedby': 'last-name-errors', 'aria-invalid': 'true'}) %} {% endif %} {{ form.last_name(**aria_attributes) }} {% for error in form.last_name.errors %} {{ error }} {% endfor %} {{gettext("First name and last name are optional")}} {{ gettext("The user's password will be:") }} {{ password }} {% set aria_attributes = {} %} {% if form.is_admin.errors %} {% do aria_attributes.update({'aria-describedby': 'is-admin-errors', 'aria-invalid': 'true'}) %} {% endif %} {{ form.is_admin(id="is-admin", **aria_attributes) }} {{ gettext('Is Admin') }} {% for error in form.is_admin.errors %} {{ error }} {% endfor %} {% set aria_attributes = {} %} {% if form.is_hotp.errors or form.otp_secret.errors %} {% do aria_attributes.update({'aria-describedby': 'otp-errors', 'aria-invalid': 'true'}) %} {% endif %} {{ form.is_hotp(id="is-hotp", **aria_attributes) }} {{ gettext("Is using a YubiKey [HOTP]") }} {{ gettext('HOTP Secret') }} {{ form.otp_secret(placeholder=gettext('HOTP Secret'), size="60", **aria_attributes) }} {% for error in form.is_hotp.errors + form.otp_secret.errors %} {{ error }} {% endfor %} {{ gettext('ADD USER') }} {% endblock %}
{{ gettext("The user's password will be:") }} {{ password }}