canaille-globuzma/canaille/templates/invite.html

145 lines
6 KiB
HTML
Raw Normal View History

2021-12-01 11:19:28 +00:00
{% extends theme('base.html') %}
2023-03-28 18:37:16 +00:00
{% import 'macro/form.html' as fui %}
2021-12-01 11:19:28 +00:00
{%- block title -%}
{%- trans %}Invite a user{% endtrans -%}
{%- endblock -%}
2023-03-10 00:02:36 +00:00
2021-12-01 11:19:28 +00:00
{% block script %}
2023-02-03 17:43:13 +00:00
<script src="/static/js/copy.js"></script>
2021-12-01 11:19:28 +00:00
{% endblock %}
2023-03-15 16:27:32 +00:00
{% block submenu %}
<nav class="ui bottom attached three item borderless menu">
<a class="item" href="{{ url_for('account.users') }}">
<i class="th list icon"></i>
{% trans %}View{% endtrans %}
</a>
<a class="item" href="{{ url_for('account.profile_creation') }}">
<i class="plus icon"></i>
{% trans %}Add{% endtrans %}
</a>
<a class="active item" href="{{ url_for('account.user_invitation') }}">
<i class="paper plane icon"></i>
{% trans %}Invite{% endtrans %}
</a>
</nav>
{% endblock %}
2021-12-01 11:19:28 +00:00
{% block content %}
2021-12-20 22:57:27 +00:00
<div class="invitationform">
{% if form_validated %}
2023-03-15 16:27:32 +00:00
<div class="ui segment">
2021-12-20 22:57:27 +00:00
<h2 class="ui center aligned header">
<div class="content">
{% if request.form["action"] == "generate" %}
{{ _("Invitation link") }}
{% elif email_sent %}
2021-12-20 22:57:27 +00:00
{{ _("Invitation sent") }}
{% else %}
{{ _("Invitation not sent") }}
{% endif %}
</div>
</h2>
2021-12-01 11:19:28 +00:00
2023-03-15 16:27:32 +00:00
{% if request.form["action"] == "generate" %}
2022-01-01 17:41:04 +00:00
2023-03-15 16:27:32 +00:00
<div class="ui success message">
{% trans %}Here is the invitation link you can provide to the user you want to invite:{% endtrans %}
</div>
2022-01-01 17:41:04 +00:00
{% elif email_sent %}
2021-12-01 11:19:28 +00:00
<div class="ui attached success message">
{% set email = form.email.data %}
2023-03-15 16:27:32 +00:00
{% trans %}This invitation link has been sent to {{ email }}{% endtrans %}
{% trans %}If you need to provide this link by other ways than email, you can copy it there:{% endtrans %}
</div>
2023-03-15 16:27:32 +00:00
{% else %}
2022-01-01 17:41:04 +00:00
<div class="ui attached error message">
{% set email = form.email.data %}
2023-03-15 16:27:32 +00:00
{% trans %}This invitation link could not be sent to {{ email }} due to technical issues.{% endtrans %}
{% trans %}However you can copy the link there to provide it by other ways than email:{% endtrans %}
</div>
2021-12-20 22:57:27 +00:00
2023-03-15 16:27:32 +00:00
{% endif %}
2021-12-20 22:57:27 +00:00
<div class="ui center aligned container">
<div class="ui fields">
<div class="ui action input">
2023-02-03 17:43:13 +00:00
<input type="text" value="{{ registration_url }}" readonly class="copy-text" id="registration-url" data-copy="registration-url">
<button class="ui primary right labeled icon button copy-button" data-copy="registration-url">
2021-12-20 22:57:27 +00:00
<i class="copy icon"></i>
{% trans %}Copy{% endtrans %}
</button>
</div>
</div>
<br>
<div class="ui stackable buttons">
<a class="ui right floated button" href="{{ url_for("account.profile_creation") }}">
{{ _("Create a user") }}
</a>
{% if request.form["action"] == "generate" or email_sent %}
2021-12-20 22:57:27 +00:00
<a href="{{ url_for('account.user_invitation') }}" class="ui right floated button" name="action" value="invite" id="invite">
{{ _("Invite another user") }}
</a>
{% endif %}
</div>
2021-12-01 11:19:28 +00:00
</div>
</div>
2021-12-20 22:57:27 +00:00
{% else %}
2021-12-01 11:19:28 +00:00
2023-03-15 16:27:32 +00:00
<div class="ui segment">
2021-12-20 22:57:27 +00:00
<h2 class="ui center aligned header">
<div class="content">
2023-01-14 19:16:01 +00:00
{{ _("Invite a user") }}
2021-12-20 22:57:27 +00:00
</div>
</h2>
2021-12-01 11:19:28 +00:00
2023-03-15 16:27:32 +00:00
<div class="ui message">
{% trans %}
After this form is sent, the recipient your indicated will receive an email
containing an account creation link.
{% endtrans %}
</div>
2021-12-01 11:19:28 +00:00
{% call fui.render_form(form) %}
{% block user_name_field scoped %}
2023-06-19 16:10:14 +00:00
{{ fui.render_input(form.user_name, icon="user") }}
2021-12-20 22:57:27 +00:00
{% endblock %}
{% block user_name_editable_field scoped %}
{{ fui.render_checkbox(form.user_name_editable) }}
2022-01-01 17:41:04 +00:00
{% endblock %}
{% block email_field scoped %}
2023-06-19 16:10:14 +00:00
{{ fui.render_input(form.email, icon="email") }}
2021-12-20 22:57:27 +00:00
{% endblock %}
{% block groups_field scoped %}
2023-06-19 16:10:14 +00:00
{{ fui.render_input(form.groups, icon="users") }}
2021-12-20 22:57:27 +00:00
{% endblock %}
<div class="ui right aligned container">
<div class="ui stackable buttons">
<a class="ui right floated button" href="{{ url_for("account.profile_creation") }}">
{{ _("Create a user") }}
</a>
2023-03-17 21:27:58 +00:00
<button type="submit" name="action" value="generate" class="ui right floated primary button">
2021-12-20 22:57:27 +00:00
{{ _("Generate a link") }}
</button>
<button type="submit" name="action" value="send" class="ui right floated primary button">
{{ _("Send the invitation") }}
</button>
</div>
</div>
{% endcall %}
2021-12-01 11:19:28 +00:00
</div>
2021-12-20 22:57:27 +00:00
{% endif %}
2021-12-01 11:19:28 +00:00
</div>
{% endblock %}