+
{% set selected_permanences = permanence_options|selectattr('entry')|list %}
Récapitulatif des permanences
{% if selected_permanences %}
| Date | Vacances | Horaire type | Horaires détaillés | |
{% for option in selected_permanences %}{{ days.get(option.date.weekday()) }} {{ option.date.strftime('%d/%m/%Y') }} | {{ option.closure.name }} | {{ option.entry.template.name if option.entry.template else 'Horaire personnalisé' }} | {{ option.entry.start_time.strftime('%H:%M') }}–{{ option.entry.end_time.strftime('%H:%M') }}{% if option.entry.lunch_start and option.entry.lunch_end %} Pause {{ option.entry.lunch_start.strftime('%H:%M') }}–{{ option.entry.lunch_end.strftime('%H:%M') }}{% endif %} | |
{% endfor %}
{% else %}
Aucune permanence enregistrée pour cette période.
{% endif %}
diff --git a/app_new/planning/time_tracking.py b/app_new/planning/time_tracking.py
index ef97e30..c4a0854 100644
--- a/app_new/planning/time_tracking.py
+++ b/app_new/planning/time_tracking.py
@@ -123,6 +123,7 @@ def time_tracking():
planned_minutes_by_month[month] = planned_minutes_by_month.get(month, 0) + day_minutes
current += timedelta(days=1)
permanence_options = []
+ permanence_groups = []
for closure in closures:
if closure.closure_type not in ("vacances", "vacances_scolaires"):
continue
@@ -133,6 +134,10 @@ def time_tracking():
existing = work_day_map.get(current_day)
permanence_options.append({"date": current_day, "closure": closure, "entry": existing})
current_day += timedelta(days=1)
+ if permanence_options:
+ group_options = [item for item in permanence_options if item["closure"].id == closure.id]
+ if group_options:
+ permanence_groups.append({"closure": closure, "options": group_options})
actual = sum(item.actual_minutes or 0 for item in entries)
# Synthèse mensuelle : les permanences sont isolées du temps de travail
# planifié habituel, et les formations viennent des convocations validées.
@@ -172,7 +177,7 @@ def time_tracking():
})
return render_template(
"planning/time_tracking.html", year=year, period_start=period_start, period_end=period_end, time_config=config, templates=templates,
- assignments=assignments, closures=closures, permanence_options=permanence_options, entries=entries,
+ assignments=assignments, closures=closures, permanence_options=permanence_options, permanence_groups=permanence_groups, entries=entries,
days={0: "Lundi", 1: "Mardi", 2: "Mercredi", 3: "Jeudi", 4: "Vendredi", 5: "Samedi", 6: "Dimanche"},
months={1: "Janvier", 2: "Février", 3: "Mars", 4: "Avril", 5: "Mai", 6: "Juin", 7: "Juillet", 8: "Août", 9: "Septembre", 10: "Octobre", 11: "Novembre", 12: "Décembre"},
planned_minutes=planned, actual_minutes=actual,