{# .. screenshot:: |canaille|/groups/admin :context: admin :align: right :width: 275px The group edition page. Group edition page. Displays the group edition or creation form. :param edited_group: :data:`None` in a creation context. In edition context this is the edited group. :type edited_group: :class:`~canaille.core.models.Group` :param form: The group edition/creation form. :type form: :class:`~canaille.core.endpoints.forms.CreateGroupForm` or :class:`~canaille.core.endpoints.forms.EditGroupForm` #} {% extends theme('base.html') %} {% import 'macro/form.html' as fui %} {% import "macro/table.html" as table %} {%- block title -%} {% if not edited_group %} {%- trans %}Group creation{% endtrans -%} {% else %} {%- trans %}Group edition{% endtrans -%} {% endif %} {%- endblock -%} {% block submenu %} {% trans %}View{% endtrans %} {% trans %}Add{% endtrans %} {% endblock %} {% block content %}

{% if not edited_group %} {% trans %}Group creation{% endtrans %} {% else %} {% trans %}Group edition{% endtrans %} {% endif %}
{% if not edited_group %} {% trans %}Create a new group{% endtrans %} {% else %} {% trans %}Edit information about a group{% endtrans %} {% endif %}

{% call fui.render_form(form, id="editgroupform" if edited_group else "creategroupform") %} {{ form.display_name() }} {{ form.description() }} {% if "members" in form %} {{ form.members() }} {% endif %} {% if "owners" in form %} {{ form.owners() }} {% endif %} {% if not edited_group %}
{% trans %}Because group cannot be empty, you will be added to the group. You can remove you later by editing your profile when you will have added other members to the group.{% endtrans %}
{% endif %}
{% if edited_group and edited_group.is_deletable_by(user) %} {% call fui.render_button(form.action, "confirm-delete", class_="ui right floated basic negative button confirm", id="confirm-delete") %} {% trans %}Delete group{% endtrans %} {% endcall %} {% endif %} {% if edited_group and user in edited_group.owners %} {% if edited_group.owner_is_removable_by(user, user) %} {% call fui.render_button(form.action, "confirm-step-down", class_="ui right floated basic button", id="confirm-step-down") %} {% trans %}Step down as owner{% endtrans %} {% endcall %} {% else %} {% endif %} {% endif %} {% call fui.render_button(form.action, "edit", class_="ui right floated primary button") %} {% if not edited_group %} {% trans %}Create group{% endtrans %} {% else %} {% trans %}Edit{% endtrans %} {% endif %} {% endcall %}
{% endcall %}
{% if edited_group %}

{% trans %}Group members{% endtrans %}

{{ table.search(table_form, "table.users") }}
{% include "core/partial/group-members.html" %} {% endif %} {% endblock %}