{% set page_title = title %} {% set active = "management.add_user" if user is not defined else "management.users" %} {% extends theme("management/management_layout.html") %} {% block breadcrumb %} {% endblock %} {% block management_content %} {%- from theme('_macros/pagination.html') import render_pagination -%} {%- from theme('_macros/form.html') import horizontal_field -%} {%- from theme('_macros/utils.html') import avatar_img -%} {#- `user` is undefined on the Add User page, hence the `is defined` guard. Only fields that can cost you your own access need confirming, so this is false for a super moderator or moderator editing themselves - they have neither field. -#} {% set editing_self = user is defined and current_user.id == user.id %} {% set confirm_self_change = editing_self and (form.primary_group is not none or form.activated is not none) %}
{{ title }}
{{ form.hidden_tag() }} {{ run_hook('flaskbb_tpl_form_user_details_before', form=form) }} {{ horizontal_field(form.username) }} {% if form.email is not none %} {{ horizontal_field(form.email) }} {% endif %} {% if form.password is not none %} {{ horizontal_field(form.password) }} {% endif %} {{ horizontal_field(form.birthday) }} {{ horizontal_field(form.gender) }} {{ horizontal_field(form.location) }} {{ horizontal_field(form.website) }} {% if form.primary_group is not none %} {{ horizontal_field(form.primary_group) }} {% endif %} {% if form.secondary_groups is not none %} {{ horizontal_field(form.secondary_groups) }} {% endif %} {% if form.activated is not none %} {{ horizontal_field(form.activated, div_class="offset-3 col-4") }} {% endif %} {{ form.delete_avatar(id="delete_avatar") }} {{ horizontal_field(form.avatar, div_class="col-5") }}
{{ avatar_img(user, size=150, class="profilepicture rounded") }}
{% if user and user.avatar %}
{% endif %}
{{ horizontal_field(form.signature, rows=4, div_class="col-sm-8") }} {{ horizontal_field(form.notes, rows=8, div_class="col-sm-8") }} {{ run_hook('flaskbb_tpl_form_user_details_after', form=form) }} {{ horizontal_field(form.submit, div_class="offset-3 col-4") }} {%- if confirm_self_change %} {#- Hidden trigger so the shared confirm_modal.js handles the dialog and the submit - it needs a real click with this button as relatedTarget, and it submits the closest form. -#} {%- endif %}
{% if confirm_self_change %} {% set confirm_title = _("Change your own account?") %} {% set confirm_message = _("You are about to change your own group or activation state. This can take away your access to the management panel, and you may not be able to undo it yourself.") %} {% include theme('_partials/confirm_dialog.html') %} {% endif %} {% endblock %} {% block scripts %} {%- if confirm_self_change %} {%- endif %} {% endblock %}