11{#
22Template for the modal popup used to change the user register for a shift bucket in /booking/admin
3- Also on the /schedule page to display more shift infos (without any action buttons)
43It use the materialize modal class https://materializeweb.com/modals.html
54id = "modal-bucket"
65#}
7- {% if (display_names ?? true ) %}
8- {% set display_names = display_name_shifters %}
9- {% endif %}
106{% set nbBookableShifts = shifts | filter ( shift => not shift .shifter ) | length %}
117{% set nbShifts = (shifts | length ) %}
128{% set nbBookedShifts = nbShifts - nbBookableShifts %}
@@ -37,9 +33,7 @@ id = "modal-bucket"
3733 {% if use_card_reader_to_validate_shifts and shift .isPastOrCurrent %}
3834 <span class =" {% if shift .wasCarriedOut %}green-text{% else %}red-text{% endif %}" >◉ </span >
3935 {% endif %}
40- {% if display_names %}
41- {{ shift .shifter .displayNameWithMemberNumber }}
42- {% endif %}
36+ {{ shift .shifter .displayNameWithMemberNumber }}
4337 {% if shift .formation %} ({{ shift .formation .name }}){% endif %}
4438 {% if not shift .formation and shift .shifter .formations | length > 0 %}
4539 <strong class =" orange-text" >({{ shift .shifter .formations | join(' , ' ) }})</strong >
@@ -60,7 +54,7 @@ id = "modal-bucket"
6054 <strong >{% if shift .fixe %}fixe{% else %}volant{% endif %}</strong >
6155 {% endif %}
6256 réservé
63- {% if shift .shifter != shift .booker .beneficiary and display_names %}
57+ {% if shift .shifter != shift .booker .beneficiary %}
6458 pour <a href =" {{ path(" member_show" , { ' member_number' : shift .shifter .membership .memberNumber }) }}" target =" _blank" >{{ shift .shifter }}</a >
6559 {% endif %}
6660 le <i >{{ shift .bookedTime | date_fr_full_with_time }}</i >
@@ -81,20 +75,18 @@ id = "modal-bucket"
8175 {% endif %}
8276 {{ form_end(shift_validate_invalidate_forms [shift .id ]) }}
8377 {% endif %}
84- {% if shift_free_forms is defined %}
85- {{ form_start(shift_free_forms [shift .id ], {' attr' : { ' style' : ' display:inline;' }}) }}
86- {% do shift_free_forms [shift .id ].reason.setRendered () %} <!-- hidden -->
87- {% if shift .isPast %}
88- <button type =" submit" class =" btn red" title =" Supprimer la participation" >
89- <i class =" material-icons left" >delete</i >Supprimer la participation
90- </button >
91- {% else %}
92- <button type =" submit" class =" btn orange" title =" Libérer" >
93- <i class =" material-icons left" >lock_open</i >Libérer
94- </button >
95- {% endif %}
96- {{ form_end(shift_free_forms [shift .id ]) }}
97- {% endif %}
78+ {{ form_start(shift_free_forms [shift .id ], {' attr' : { ' style' : ' display:inline;' }}) }}
79+ {% do shift_free_forms [shift .id ].reason.setRendered () %} <!-- hidden -->
80+ {% if shift .isPast %}
81+ <button type =" submit" class =" btn red" title =" Supprimer la participation" >
82+ <i class =" material-icons left" >delete</i >Supprimer la participation
83+ </button >
84+ {% else %}
85+ <button type =" submit" class =" btn orange" title =" Libérer" >
86+ <i class =" material-icons left" >lock_open</i >Libérer
87+ </button >
88+ {% endif %}
89+ {{ form_end(shift_free_forms [shift .id ]) }}
9890 {% endif %}
9991 <!-- shift.createdBy -->
10092 {% if shift .createdBy %}
@@ -112,13 +104,8 @@ id = "modal-bucket"
112104 <div class =" col s12" >
113105 <b >
114106 <span style =" font-style: italic" >
115- {% if shift .lastShifter %}
116- réservé
117- {% if display_names %}
118- à {{ shift .lastShifter .displayNameWithMemberNumber }}
119- {% endif %}
120- {% else %}
121- libre
107+ {% if shift .lastShifter %}réservé à {{ shift .lastShifter .displayNameWithMemberNumber }}
108+ {% else %}libre
122109 {% endif %}
123110 </span >
124111 </b >
@@ -132,32 +119,29 @@ id = "modal-bucket"
132119 </div >
133120 <div class =" collapsible-body" >
134121 <!-- shift book form -->
135- {% if shift_book_forms is defined %}
136- {{ form_start(shift_book_forms [shift .id ], {' attr' : { ' style' : ' display:inline;' }}) }}
137- <div class =" row" >
138- <div class =" col {% if use_fly_and_fixed %}s7{% else %}s9{% endif %} input-field" >
139- {{ form_label(shift_book_forms [shift .id ].shifter) }}
140- {{ form_widget(shift_book_forms [shift .id ].shifter) }}
122+ {{ form_start(shift_book_forms [shift .id ], {' attr' : { ' style' : ' display:inline;' }}) }}
123+ <div class =" row" >
124+ <div class =" col {% if use_fly_and_fixed %}s7{% else %}s9{% endif %} input-field" >
125+ {{ form_label(shift_book_forms [shift .id ].shifter) }}
126+ {{ form_widget(shift_book_forms [shift .id ].shifter) }}
127+ </div >
128+ {% if use_fly_and_fixed %}
129+ <div class =" col s2 input-field" >
130+ {{ form_widget(shift_book_forms [shift .id ].fixe) }}
141131 </div >
142- {% if use_fly_and_fixed %}
143- <div class =" col s2 input-field" >
144- {{ form_widget( shift_book_forms [ shift . id ].fixe) } }
145- </ div >
132+ {% endif %}
133+ <div class =" col s3 input-field" >
134+ {% if not use_fly_and_fixed % }
135+ {{ form_widget( shift_book_forms [ shift . id ].fixe) }}
146136 {% endif %}
147- <div class =" col s3 input-field" >
148- {% if not use_fly_and_fixed %}
149- {{ form_widget(shift_book_forms [shift .id ].fixe) }}
150- {% endif %}
151- <button type =" submit" class =" btn" >
152- <i class =" material-icons left" >add</i >Ajouter
153- </button >
154- </div >
137+ <button type =" submit" class =" btn" >
138+ <i class =" material-icons left" >add</i >Ajouter
139+ </button >
155140 </div >
156- {{ form_end(shift_book_forms [shift .id ]) }}
157- {% endif %}
158-
141+ </div >
142+ {{ form_end(shift_book_forms [shift .id ]) }}
159143 <!-- shift delete form -->
160- {% if is_granted(" ROLE_ADMIN" ) and shift_delete_forms is defined %}
144+ {% if is_granted(" ROLE_ADMIN" ) %}
161145 {% if not shift .lastShifter %}
162146 {{ form_start(shift_delete_forms [shift .id ]) }}
163147 <button type =" submit" title =" Supprimer le poste" class =" btn red" >
@@ -180,60 +164,49 @@ id = "modal-bucket"
180164</ul >
181165
182166{# add shift form #}
183- {% if bucket_shift_add_form is defined %}
184- {{ form_start(bucket_shift_add_form , {' attr' : { ' style' : ' display:inline;' }}) }}
185- <input type =" hidden" id =" {{ bucket_shift_add_form .start .date .vars .id }}" name =" {{ bucket_shift_add_form .start .date .vars .full_name }}" value =" {{ bucket_shift_add_form .start .date .vars .value }}" >
186- <input type =" hidden" id =" {{ bucket_shift_add_form .start .time .vars .id }}" name =" {{ bucket_shift_add_form .start .time .vars .full_name }}" value =" {{ bucket_shift_add_form .start .time .vars .value }}" >
187- <input type =" hidden" id =" {{ bucket_shift_add_form .end .date .vars .id }}" name =" {{ bucket_shift_add_form .end .date .vars .full_name }}" value =" {{ bucket_shift_add_form .end .date .vars .value }}" >
188- <input type =" hidden" id =" {{ bucket_shift_add_form .end .time .vars .id }}" name =" {{ bucket_shift_add_form .end .time .vars .full_name }}" value =" {{ bucket_shift_add_form .end .time .vars .value }}" >
189- {{ form_widget(bucket_shift_add_form .job ) }}
190- <div class =" row valign-wrapper" >
191- <div class =" col s3" >
192- {{ form_label(bucket_shift_add_form .number ) }}
193- {{ form_widget(bucket_shift_add_form .number ) }}
194- </div >
195- <div class =" col s6" >
196- {{ form_label(bucket_shift_add_form .formation ) }}
197- {{ form_widget(bucket_shift_add_form .formation ) }}
198- </div >
199- <div class =" col s3" >
200- <button type =" submit" class =" btn waves-effect waves-light teal" >
201- <i class =" material-icons left" >add</i >Ajouter
202- </button >
203- </div >
167+ {{ form_start(bucket_shift_add_form , {' attr' : { ' style' : ' display:inline;' }}) }}
168+ <input type =" hidden" id =" {{ bucket_shift_add_form .start .date .vars .id }}" name =" {{ bucket_shift_add_form .start .date .vars .full_name }}" value =" {{ bucket_shift_add_form .start .date .vars .value }}" >
169+ <input type =" hidden" id =" {{ bucket_shift_add_form .start .time .vars .id }}" name =" {{ bucket_shift_add_form .start .time .vars .full_name }}" value =" {{ bucket_shift_add_form .start .time .vars .value }}" >
170+ <input type =" hidden" id =" {{ bucket_shift_add_form .end .date .vars .id }}" name =" {{ bucket_shift_add_form .end .date .vars .full_name }}" value =" {{ bucket_shift_add_form .end .date .vars .value }}" >
171+ <input type =" hidden" id =" {{ bucket_shift_add_form .end .time .vars .id }}" name =" {{ bucket_shift_add_form .end .time .vars .full_name }}" value =" {{ bucket_shift_add_form .end .time .vars .value }}" >
172+ {{ form_widget(bucket_shift_add_form .job ) }}
173+ <div class =" row valign-wrapper" >
174+ <div class =" col s3" >
175+ {{ form_label(bucket_shift_add_form .number ) }}
176+ {{ form_widget(bucket_shift_add_form .number ) }}
204177 </div >
205- {{ form_row(bucket_shift_add_form ._token ) }}
206- {{ form_end(bucket_shift_add_form , {' render_rest' : false }) }}
207- {% endif %}
208-
209- {# bucket actions #}
210- {% if display_send_email_button ?? false and is_granted(" ROLE_ADMIN_PANEL" ) %}
211- <a href =" {{ path(' mail_bucketshift' , { ' id' : bucket .id }) }}" class =" btn" >
212- <i class =" material-icons left" >mail</i >Envoyer un email
213- </a >
214- {% endif %}
215-
216- {% if bucket_lock_unlock_form is defined %}
217- {{ form_start(bucket_lock_unlock_form , {' attr' : { ' style' : ' display:inline;' }}) }}
218- {% if bucket .locked %}
219- <button type =" submit" class =" btn orange" >
220- <i class =" material-icons left" >lock_open</i >Déverrouiller
221- </button >
222- {% else %}
223- <button type =" submit" class =" btn orange" >
224- <i class =" material-icons left" >lock</i >Verrouiller
178+ <div class =" col s6" >
179+ {{ form_label(bucket_shift_add_form .formation ) }}
180+ {{ form_widget(bucket_shift_add_form .formation ) }}
181+ </div >
182+ <div class =" col s3" >
183+ <button type =" submit" class =" btn waves-effect waves-light teal" >
184+ <i class =" material-icons left" >add</i >Ajouter
225185 </button >
226- {% endif %}
227- {{ form_end(bucket_lock_unlock_form ) }}
228- {% endif %}
186+ </div >
187+ </div >
188+ {{ form_row(bucket_shift_add_form ._token ) }}
189+ {{ form_end(bucket_shift_add_form , {' render_rest' : false }) }}
229190
230- {% if display_edit_button ?? false and is_granted(" ROLE_SHIFT_MANAGER" ) %}
231- <a href =" {{ path(' bucket_edit' , { ' id' : bucket .id }) }}" class =" btn deep-purple" >
232- <i class =" material-icons left" >edit</i >Editer
233- </a >
191+ {# bucket actions #}
192+ <a href =" {{ path(' mail_bucketshift' , { ' id' : bucket .id }) }}" class =" btn" >
193+ <i class =" material-icons left" >mail</i >Envoyer un email
194+ </a >
195+ {{ form_start(bucket_lock_unlock_form , {' attr' : { ' style' : ' display:inline;' }}) }}
196+ {% if bucket .locked %}
197+ <button type =" submit" class =" btn orange" >
198+ <i class =" material-icons left" >lock_open</i >Déverrouiller
199+ </button >
200+ {% else %}
201+ <button type =" submit" class =" btn orange" >
202+ <i class =" material-icons left" >lock</i >Verrouiller
203+ </button >
234204{% endif %}
235-
236- {% if is_granted(" ROLE_ADMIN" ) and bucket_delete_form is defined %}
205+ {{ form_end(bucket_lock_unlock_form ) }}
206+ <a href =" {{ path(' bucket_edit' , { ' id' : bucket .id }) }}" class =" btn deep-purple" >
207+ <i class =" material-icons left" >edit</i >Editer
208+ </a >
209+ {% if is_granted(" ROLE_ADMIN" ) %}
237210 <!-- bucket delete is allowed only if all shifts are free -->
238211 {{ form_start(bucket_delete_form , {' attr' : { ' style' : ' display:inline;' }}) }}
239212 <button id =" bucket_delete" class =" btn red" title =" Supprimer tous les créneaux à cette heure et ce poste" {% if not use_time_log_saving and (nbBookedShifts > 0 ) %}disabled {% endif %}>
0 commit comments