1 {% set can_edit = group.canEdit(login) %}
3 {% set managers = group.getManagers() %}
4 {% set members = group.getMembers() %}
6 <div class="ui stackable pointing inverted menu tabbed">
7 <div class="item header">
8 <i class="users cog icon"></i>
9 {{ group.getFullName() }} :
11 <a href="{{ url_for('groups', {'id': group.getId()}) }}?tab=group_information" class="item{{ tab == 'group_information' ? ' active' }}" data-tab="group_information">{{ _T("Information") }}</a>
12 <a href="{{ url_for('groups', {'id': group.getId()}) }}?tab=group_managers" class="item{{ tab == 'group_managers' ? ' active' }}" data-tab="group_managers">{{ _T("Managers") }} ({{ managers|length }})</a>
13 <a href="{{ url_for('groups', {'id': group.getId()}) }}?tab=group_members" class="item{{ tab == 'group_members' ? ' active' }}" data-tab="group_members">{{ _T("Members") }} ({{ members|length }})</a>
15 <form class="ui form" action="{{ url_for("doEditGroup", {"id": group.getId()}) }}" method="post" enctype="multipart/form-data" id="group_form">
16 <div class="ui{{ tab == 'group_information' ? ' active' }} tab segment" data-tab="group_information">
17 <div class="ui basic segment">
18 {% if group.getId() %}
19 <div class="inline field">
20 <label>{{ _T("Creation date:") }}</label>
21 <span>{{ group.getCreationDate() }}</span>
24 <div class="inline field{% if can_edit %} required{% endif %}">
25 <label for="group_name">{{ _T("Name:") }}</label>
27 <input type="text" name="group_name" id="group_name" value="{{ group.getName() }}" maxlength="250" required/>
29 <span>{{ group.getName() }}</span>
33 {% if group.getParentGroup() %}
34 {% set pgroup = group.getParentGroup() %}
36 <div class="inline field">
37 <label for="parent_group">{{ _T("Parent group:") }}</label>
38 {% if can_edit and parent_groups|length > 0 %}
39 <select name="parent_group" id="parent_group" class="ui search dropdown nochosen">
40 <option value="">{{ _T("None") }}</option>
41 {% for g in parent_groups %}
42 <option value="{{ g.getId() }}"{% if pgroup is defined and pgroup.getId() == g.getId() %} selected="selected"{% endif %}>{{ g.getIndentName()|raw }}</option>
47 {% if pgroup is defined %}
48 {{ pgroup.getName() }}
49 <input type="hidden" name="parent_group" value="{{ pgroup.getId() }}"/>
52 <input type="hidden" name="parent_group" value=""/>
60 <div id="group_managers" class="ui{{ tab == 'group_managers' ? ' active' }} tab segment" data-tab="group_managers">
61 <div class="ui basic segment">
63 {% if login.isAdmin() or login.isStaff() %}
64 <a href="#" class="jsonly disabled ui labeled icon button" id="btnmanagers_small">
65 <i class="user shield icon" aria-hidden="true"></i>
66 {{ _T("Manage managers") }}
69 {% include "elements/group_persons.html.twig" with {'person_mode': "managers", 'persons': managers} %}
74 <div id="group_members" class="ui{{ tab == 'group_members' ? ' active' }} tab segment" data-tab="group_members">
75 <div class="ui basic segment">
77 {% if login.isAdmin() or login.isStaff() %}
78 <a href="#" class="jsonly disabled ui labeled icon button" id="btnusers_small">
79 <i class="user icon" aria-hidden="true"></i>
80 {{ _T("Manage members") }}
83 {% include "elements/group_persons.html.twig" with {'person_mode': "members", 'persons': members} %}
88 <div class="ui basic center aligned segment">
89 <div class="ui wrapping spaced buttons">
91 <button type="submit" name="valid" class="ui labeled icon primary button action">
92 <i class="save icon"></i> {{ _T("Save") }}
94 <input type="hidden" name="id_group" id="id_group" value="{{ group.getId() }}"/>
95 <input type="hidden" name="tab" id="tab" value="{{ tab }}"/>
96 {% include "components/forms/csrf.html.twig" %}
99 <a href="{{ url_for("pdf_groups", {"id": group.getId()}) }}" class="ui labeled icon button tooltip" title="{{ _T("Current group (and attached people) as PDF") }}">
100 <i class="file pdf red icon" aria-hidden="true"></i>
101 {{ _T("Group PDF") }}
104 {% if login.isAdmin() or login.isStaff() %}
105 <a class="ui labeled icon button delete" id="delete" href="{{ url_for("removeGroup", {"id": group.getId()}) }}">
106 <i class="trash alt red icon" aria-hidden="true"></i>
113 <script type="text/javascript">
115 var _btnaid = '#newgroup';
116 var _btnuid = '#btnusers_small';
117 var _btnmid = '#btnmanagers_small';
120 $('.menu.tabbed .item').tab({
121 onFirstLoad: function(tabPath) {
122 {% if login.isAdmin() or login.isStaff() %}
123 if (tabPath == 'group_managers') {
124 $(_btnaid).addClass('displaynone');
125 $(_btnuid).addClass('displaynone');
126 } else if ( tabPath == 'group_members' ) {
127 $(_btnaid).addClass('displaynone');
128 $(_btnmid).addClass('displaynone');
129 } else if ( tabPath == 'group_information' ) {
130 $(_btnuid).addClass('displaynone');
131 $(_btnmid).addClass('displaynone');
135 onVisible: function(tabPath) {
136 document.getElementById('tab').value = tabPath;
137 {% if login.isAdmin() or login.isStaff() %}
138 if ( tabPath == 'group_managers' ) {
139 $(_btnmid).removeClass('displaynone');
140 $(_btnaid).addClass('displaynone');
141 if ( !$(_btnuid).hasClass('displaynone') ) {
142 $(_btnuid).addClass('displaynone');
144 } else if ( tabPath == 'group_members' ) {
145 $(_btnuid).removeClass('displaynone');
146 $(_btnaid).addClass('displaynone');
147 if ( !$(_btnmid).hasClass('displaynone') ) {
148 $(_btnmid).addClass('displaynone');
150 } else if ( tabPath == 'group_information' ) {
151 $(_btnaid).removeClass('displaynone');
152 $(_btnuid).addClass('displaynone');
153 $(_btnmid).addClass('displaynone');
157 }).tab('change tab', '{{ tab }}');