canaille-globuzma/canaille/core/templates/profile_add.html

202 lines
8.3 KiB
HTML
Raw Normal View History

{% extends theme('base.html') %}
2023-03-28 18:37:16 +00:00
{% import 'macro/form.html' as fui %}
{% import 'partial/profile_field.html' as profile %}
2020-10-20 09:44:45 +00:00
{%- block title -%}
2023-03-17 08:27:48 +00:00
{%- trans %}User creation{% endtrans -%}
{%- endblock -%}
2023-03-10 00:02:36 +00:00
2020-11-01 10:33:56 +00:00
{% block script %}
<script src="{{ url_for("static", filename="js/profile.js") }}" defer></script>
2020-11-01 10:33:56 +00:00
{% endblock %}
2023-03-15 16:27:32 +00:00
{% block submenu %}
<a class="item" href="{{ url_for('core.account.users') }}">
<i class="th list icon"></i>
{% trans %}View{% endtrans %}
</a>
<a class="active item" href="{{ url_for('core.account.profile_creation') }}">
<i class="plus icon"></i>
{% trans %}Add{% endtrans %}
</a>
{% if has_smtp %}
<a class="item" href="{{ url_for('core.account.user_invitation') }}">
<i class="paper plane icon"></i>
{% trans %}Invite{% endtrans %}
2023-03-17 08:27:48 +00:00
</a>
{% endif %}
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">
{% trans %}User creation{% endtrans %}
2021-12-20 22:57:27 +00:00
</div>
<div class="sub header">
{% trans %}Create a new user account{% endtrans %}
2021-12-20 22:57:27 +00:00
</div>
</h2>
{% 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>
{% 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 %}
{{ 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"
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"
for="{{ form.photo.id }}"
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">
{% endif %}
2021-12-08 17:06:50 +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">
{% if "given_name" in form %}
{% 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
{% if "family_name" in form %}
{% 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
{% if "display_name" in form %}
{% block display_name_field scoped %}{{ profile.render_field(form.display_name) }}{% endblock %}
{% endif %}
{% 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 %}
{% 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
{% if "phone_numbers" in form %}
{% block phone_numbers_field scoped %}{{ profile.render_field(form.phone_numbers) }}{% endblock %}
2021-12-20 22:57:27 +00:00
{% endif %}
{% if "formatted_address" in form %}
{% block formatted_address_field scoped %}{{ profile.render_field(form.formatted_address) }}{% endblock %}
{% endif %}
{% if "street" in form %}
{% block street_field scoped %}{{ profile.render_field(form.street) }}{% endblock %}
{% endif %}
2023-03-11 21:34:29 +00:00
<div class="equal width fields">
{% if "postal_code" in form %}
{% block postal_code_field scoped %}{{ profile.render_field(form.postal_code) }}{% endblock %}
{% endif %}
{% if "locality" in form %}
{% block locality_field scoped %}{{ profile.render_field(form.locality) }}{% endblock %}
{% endif %}
{% if "region" in form %}
{% block region_field scoped %}{{ profile.render_field(form.region) }}{% endblock %}
{% endif %}
</div>
2023-03-17 16:35:05 +00:00
<div class="equal width fields">
2023-03-11 11:52:36 +00:00
{% if "department" in form %}
{% 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
{% if "employee_number" in form %}
{% 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 %}
{% block title_field scoped %}{{ profile.render_field(form.title) }}{% endblock %}
2023-03-17 16:35:05 +00:00
{% endif %}
{% if "organization" in form %}
{% 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
{% if "profile_url" in form %}
{% 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
{% if "preferred_language" in form %}
{% block preferred_language_field scoped %}{{ profile.render_field(form.preferred_language) }}{% endblock %}
{% 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
{% if "user_name" in form %}
{% 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 %}
{% 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">
{{ 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
{% 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>
<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-08-15 14:17:19 +00:00
{% if not user %}
<a type="button" class="ui right floated button" href="{{ url_for('core.auth.login') }}">{{ _("Login page") }}</a>
{% endif %}
<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>
{% endcall %}
2021-12-20 22:57:27 +00:00
</div>
2020-10-20 09:44:45 +00:00
{% endblock %}