Skip to content

Commit

Permalink
Vérification de l'existence des cyles avant l'affichage des créneaux (#…
Browse files Browse the repository at this point in the history
…1097)

Co-authored-by: Sébastien Bianco <seb.bianco@free.fr>
  • Loading branch information
sebastienbianco and Sébastien Bianco committed Jan 3, 2024
1 parent 5171708 commit ecb28eb
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions app/Resources/views/booking/home_booked_shifts.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,21 @@
<div class="row">
{% for cycle in -1..(-1 * max_nb_of_past_cycles_to_display) %}
<div class="col s12 m6 xl4">
{% set previousShifts = shifts_by_cycle[cycle] %}
<h6>Cycle précédent (du {{ membership_service.startOfCycle(member,cycle) | date_short }} au {{ membership_service.endOfCycle(member,cycle) | date_short }})</h6>
{% if previousShifts | length > 0 %}
{% for shift in previousShifts %}
<div class="col s12 m12">
{% include "user/_partial/mini_shift_card.html.twig" with { shift: shift } %}
</div>
{% endfor %}
{% set iscycleexist = cycle in shifts_by_cycle|keys %}
{% if iscycleexist %}
{% set previousShifts = shifts_by_cycle[cycle] %}
{% if previousShifts | length > 0 %}
{% for shift in previousShifts %}
<div class="col s12 m12">
{% include "user/_partial/mini_shift_card.html.twig" with { shift: shift } %}
</div>
{% endfor %}
{% else %}
Pas de créneau
{% endif %}
{% else %}
Pas de créneau
Pas de créneau
{% endif %}
</div>
{% endfor %}
Expand Down

0 comments on commit ecb28eb

Please sign in to comment.