2021-10-28 13:24:34 +00:00
{% extends theme('base.html') %}
2023-03-28 18:37:16 +00:00
{% import 'macro/form.html' as fui %}
2023-07-01 17:56:13 +00:00
{% import 'partial/profile_field.html' as profile %}
2020-10-20 09:44:45 +00:00
2023-03-16 18:30:30 +00:00
{%- block title -%}
2023-03-17 08:27:48 +00:00
{%- trans %}User creation{% endtrans -%}
2023-03-16 18:30:30 +00:00
{%- endblock -%}
2023-03-10 00:02:36 +00:00
2020-11-01 10:33:56 +00:00
{% block script %}
2023-06-26 16:00:58 +00:00
< script src = "/static/js/profile.js" defer > < / script >
2020-11-01 10:33:56 +00:00
{% endblock %}
2023-03-15 16:27:32 +00:00
{% block submenu %}
2023-03-17 08:27:48 +00:00
< nav class = "ui bottom attached {% if has_smtp %}three{% else %}two{% endif %} item borderless menu" >
2023-08-14 11:52:24 +00:00
< a class = "item" href = "{{ url_for('core.account.users') }}" >
2023-03-17 08:27:48 +00:00
< i class = "th list icon" > < / i >
{% trans %}View{% endtrans %}
< / a >
2023-08-14 11:52:24 +00:00
< a class = "active item" href = "{{ url_for('core.account.profile_creation') }}" >
2023-03-17 08:27:48 +00:00
< i class = "plus icon" > < / i >
{% trans %}Add{% endtrans %}
< / a >
{% if has_smtp %}
2023-08-14 11:52:24 +00:00
< a class = "item" href = "{{ url_for('core.account.user_invitation') }}" >
2023-03-17 08:27:48 +00:00
< i class = "paper plane icon" > < / i >
{% trans %}Invite{% endtrans %}
2023-03-15 16:27:32 +00:00
< / a >
2023-03-17 08:27:48 +00:00
{% endif %}
< / nav >
2023-03-15 16:27:32 +00:00
{% endblock %}
2020-10-20 09:44:45 +00:00
{% block content %}
2021-12-20 22:57:27 +00:00
< div class = "ui clearing segment" >
< h2 class = "ui center aligned header" >
< div class = "content" >
2023-07-01 17:56:13 +00:00
{% trans %}User creation{% endtrans %}
2021-12-20 22:57:27 +00:00
< / div >
< div class = "sub header" >
2023-07-01 17:56:13 +00:00
{% trans %}Create a new user account{% endtrans %}
2021-12-20 22:57:27 +00:00
< / div >
< / h2 >
2023-03-28 21:12:54 +00:00
{% call fui.render_form(form, class_="profile-form info") %}
2021-12-20 22:57:27 +00:00
< h4 class = "ui dividing header" > {% trans %}Personal information{% endtrans %}< / h4 >
2023-02-05 17:57:18 +00:00
{% if "photo" in form %}
2021-12-20 22:57:27 +00:00
< div class = "ui grid" >
< div class = "three wide column" >
{% block photo_field scoped %}
2023-07-01 17:56:13 +00:00
{{ profile.render_field(form.photo, display=false, class="photo-field") }}
{{ profile.render_field(form.photo_delete, display=false, class="photo-delete-button") }}
2021-12-20 22:57:27 +00:00
< label
class="ui small bordered image photo-content"
2023-02-05 17:57:18 +00:00
for="{{ form.photo.id }}"
2021-12-20 22:57:27 +00:00
title="{{ _("Click to upload a photo") }}"
2023-03-17 08:27:48 +00:00
style="display: none;">
2021-12-20 22:57:27 +00:00
< a class = "ui right corner label photo-delete-icon" title = "{{ _(" Delete the photo " ) } } " >
< i class = "times icon" > < / i >
< / a >
2023-03-17 08:27:48 +00:00
< img src = "" alt = "User photo" >
2021-12-20 22:57:27 +00:00
< / label >
< label
class="ui centered photo-placeholder"
2023-02-05 17:57:18 +00:00
for="{{ form.photo.id }}"
2023-07-01 17:56:13 +00:00
title="{{ _("Click to upload a photo") }}">
2021-12-20 22:57:27 +00:00
< i class = "massive centered portrait icon" > < / i >
< / label >
{% endblock %}
2023-03-17 21:27:58 +00:00
< / div >
2021-12-20 22:57:27 +00:00
2023-03-17 21:27:58 +00:00
< div class = "thirteen wide column" >
2020-11-26 14:29:14 +00:00
{% endif %}
2021-12-08 17:06:50 +00:00
2023-02-05 17:57:18 +00:00
{% if "given_name" in form or "family_name" in form %}
2023-03-11 21:34:29 +00:00
< div class = "equal width fields" >
2023-02-05 17:57:18 +00:00
{% if "given_name" in form %}
2023-07-01 17:56:13 +00:00
{% block given_name_field scoped %}{{ profile.render_field(form.given_name) }}{% endblock %}
2023-03-11 21:34:29 +00:00
{% endif %}
2021-12-08 17:06:50 +00:00
2023-02-05 17:57:18 +00:00
{% if "family_name" in form %}
2023-07-01 17:56:13 +00:00
{% block family_name_field scoped %}{{ profile.render_field(form.family_name) }}{% endblock %}
2023-03-11 21:34:29 +00:00
{% endif %}
< / div >
{% endif %}
2021-12-13 22:04:34 +00:00
2023-02-05 17:57:18 +00:00
{% if "display_name" in form %}
2023-07-01 17:56:13 +00:00
{% block display_name_field scoped %}{{ profile.render_field(form.display_name) }}{% endblock %}
2022-12-02 17:47:16 +00:00
{% endif %}
2023-02-05 17:57:18 +00:00
{% if "photo" in form %}< / div > < / div > {% endif %}
2021-12-22 10:06:13 +00:00
2023-06-22 13:14:07 +00:00
{% if "emails" in form %}
2023-07-01 17:56:13 +00:00
{% block emails_field scoped %}{{ profile.render_field(form.emails) }}{% endblock %}
2021-12-20 22:57:27 +00:00
{% endif %}
2020-11-02 10:39:00 +00:00
2023-06-22 13:33:03 +00:00
{% if "phone_numbers" in form %}
2023-07-01 17:56:13 +00:00
{% block phone_numbers_field scoped %}{{ profile.render_field(form.phone_numbers) }}{% endblock %}
2021-12-20 22:57:27 +00:00
{% endif %}
2021-01-13 08:55:07 +00:00
2023-02-05 17:57:18 +00:00
{% if "formatted_address" in form %}
2023-07-01 17:56:13 +00:00
{% block formatted_address_field scoped %}{{ profile.render_field(form.formatted_address) }}{% endblock %}
2022-07-07 12:35:17 +00:00
{% endif %}
2023-03-11 19:11:55 +00:00
{% if "street" in form %}
2023-07-01 17:56:13 +00:00
{% block street_field scoped %}{{ profile.render_field(form.street) }}{% endblock %}
2023-03-11 19:11:55 +00:00
{% endif %}
2023-03-11 21:34:29 +00:00
< div class = "equal width fields" >
2023-02-05 17:57:18 +00:00
{% if "postal_code" in form %}
2023-07-01 17:56:13 +00:00
{% block postal_code_field scoped %}{{ profile.render_field(form.postal_code) }}{% endblock %}
2023-03-11 19:11:55 +00:00
{% endif %}
2023-02-05 17:57:18 +00:00
{% if "locality" in form %}
2023-07-01 17:56:13 +00:00
{% block locality_field scoped %}{{ profile.render_field(form.locality) }}{% endblock %}
2023-03-11 19:11:55 +00:00
{% endif %}
2023-02-05 17:57:18 +00:00
{% if "region" in form %}
2023-07-01 17:56:13 +00:00
{% block region_field scoped %}{{ profile.render_field(form.region) }}{% endblock %}
2023-03-11 19:11:55 +00:00
{% endif %}
< / div >
2023-03-17 16:35:05 +00:00
< div class = "equal width fields" >
2023-03-11 11:52:36 +00:00
2023-02-05 17:57:18 +00:00
{% if "department" in form %}
2023-07-01 17:56:13 +00:00
{% block department_field scoped %}{{ profile.render_field(form.department) }}{% endblock %}
2023-03-17 16:35:05 +00:00
{% endif %}
2023-03-11 11:52:36 +00:00
2023-02-05 17:57:18 +00:00
{% if "employee_number" in form %}
2023-07-01 17:56:13 +00:00
{% block employee_number_field scoped %}{{ profile.render_field(form.employee_number) }}{% endblock %}
2023-03-17 16:35:05 +00:00
{% endif %}
< / div >
< div class = "equal width fields" >
{% if "title" in form %}
2023-07-01 17:56:13 +00:00
{% block title_field scoped %}{{ profile.render_field(form.title) }}{% endblock %}
2023-03-17 16:35:05 +00:00
{% endif %}
2023-02-05 17:57:18 +00:00
{% if "organization" in form %}
2023-07-01 17:56:13 +00:00
{% block organization_field scoped %}{{ profile.render_field(form.organization) }}{% endblock %}
2023-03-17 16:35:05 +00:00
{% endif %}
< / div >
2023-03-11 11:52:36 +00:00
2023-02-05 17:57:18 +00:00
{% if "profile_url" in form %}
2023-07-01 17:56:13 +00:00
{% block profile_uri_field scoped %}{{ profile.render_field(form.profile_url) }}{% endblock %}
2021-12-20 22:57:27 +00:00
{% endif %}
2021-01-22 17:26:53 +00:00
2023-02-05 17:57:18 +00:00
{% if "preferred_language" in form %}
2023-07-01 17:56:13 +00:00
{% block preferred_language_field scoped %}{{ profile.render_field(form.preferred_language) }}{% endblock %}
2022-11-20 21:12:18 +00:00
{% endif %}
2023-06-30 16:10:16 +00:00
< h4 class = "ui dividing header" > {% trans %}Account settings{% endtrans %}< / h4 >
2021-01-22 17:26:53 +00:00
2023-02-05 17:57:18 +00:00
{% if "user_name" in form %}
2023-07-01 17:56:13 +00:00
{% block user_name_field scoped %}{{ profile.render_field(form.user_name) }}{% endblock %}
2021-12-20 22:57:27 +00:00
{% endif %}
2021-12-01 11:19:28 +00:00
2021-12-20 22:57:27 +00:00
{% if "groups" in form %}
2023-07-01 17:56:13 +00:00
{% block groups_field scoped %}{{ profile.render_field(form.groups) }}{% endblock %}
2021-12-20 22:57:27 +00:00
{% endif %}
2021-01-22 17:26:53 +00:00
2021-12-20 22:57:27 +00:00
{% if "password1" in form %}
{% block password_field scoped %}
< div class = "two fields" >
2023-07-01 17:56:13 +00:00
{{ profile.render_field(form.password1, noindicator=true) }}
{{ profile.render_field(form.password2, noindicator=true) }}
2021-12-20 22:57:27 +00:00
< / div >
{% endblock %}
{% endif %}
2021-12-01 11:19:28 +00:00
2023-07-01 17:56:13 +00:00
{% if user and user.can_manage_users %}
2021-12-20 22:57:27 +00:00
2023-03-17 08:27:48 +00:00
< div class = "ui message info" >
< div class = "header" >
{% trans %}User password is not mandatory{% endtrans %}
2021-12-20 22:57:27 +00:00
< / div >
2023-07-01 17:56:13 +00:00
< p >
{% if has_smtp %}
{% trans %}The user will not be able to authenticate unless the password is set, but they will be able to ask for a password initialization mail.{% endtrans %}
{% else %}
{% trans %}The user will not be able to authenticate unless the password is set.{% endtrans %}
{% endif %}
< / p >
2023-03-17 08:27:48 +00:00
< / div >
2021-07-01 07:55:40 +00:00
2023-03-17 08:27:48 +00:00
{% endif %}
2021-12-01 11:19:28 +00:00
2023-03-17 08:27:48 +00:00
< div class = "ui right aligned container" >
< div class = "ui stackable buttons" >
2023-07-30 21:08:17 +00:00
< button type = "submit" class = "ui right floated primary button" name = "action" value = "create-profile" id = "create-profile" >
2021-12-20 22:57:27 +00:00
{{ _("Submit") }}
< / button >
< / div >
2021-07-01 07:55:40 +00:00
< / div >
2023-07-01 17:56:13 +00:00
2023-03-28 21:12:54 +00:00
{% endcall %}
2021-12-20 22:57:27 +00:00
< / div >
2020-10-20 09:44:45 +00:00
{% endblock %}