{% extends "base.html" %} {% block content %}
Statistiques
{{ stats.n_jours }} jours complets analysés · {{ stats.total_weeks }} semaines {% if stats.avg_delta_min != 0 %} · solde moyen {{ stats.avg_delta }}/sem {% endif %}
{# ── 3 période-conformité cards ── #}
{% set periods = [ (stats.comp_globale, "Conformité globale", "Toutes périodes"), (stats.comp_mois, "Ce mois", stats.mois_label), (stats.comp_sem_n1, "Semaine précédente", stats.prev_week_label), ] %} {% for comp, title, sub in periods %} {% set pct = comp.pct %} {% set cls = 'comp-ok' if pct is not none and pct >= 95 else ('comp-warn' if pct is not none and pct >= 80 else 'comp-bad') %}
{{ title }}
{{ sub }}
{% if pct is not none %}{{ comp.n_ok }}/{{ comp.n }} jours conformes {% else %}pas de données{% endif %}
{% endfor %}
{# ── Onglets de période ── #}
Période d'analyse
{# ── 4 time-slot cards ── #}
{% set slot_meta = [ ("matin_entree", "Entrée matin", "≤ " ~ stats.plages.matin_debut, "le", "matin"), ("matin_sortie", "Sortie matin", "≥ " ~ stats.plages.matin_fin, "ge", "matin"), ("aprem_entree", "Entrée après-midi","≤ " ~ stats.plages.aprem_debut,"le", "aprem"), ("aprem_sortie", "Sortie après-midi","≥ " ~ stats.plages.aprem_fin, "ge", "aprem"), ] %} {% for slot, label, constraint, op, half in slot_meta %} {% set ts = stats.time_stats[slot] %} {% set comp = stats.compliance[slot] %}
{{ label }}
{% if ts %}
{{ ts.mean_hhmm }}
{% if comp is not none %}
{{ constraint }}
{% endif %}
σ = {{ ts.sigma_min }} min · n = {{ ts.n }}
μ = {{ ts.mean_hhmm }} {{ constraint }} ±1σ ({{ ts.sigma_min }} min) n = {{ ts.n }} jours
{% else %}
pas de données
{% endif %}
{% endfor %}
{# ── Weekly balance chart ── #} {% if stats.weekly_balances %}
Soldes hebdomadaires (jours incomplets exclus)
{% set has_partial = stats.weekly_balances | selectattr("partial") | list %} {% if has_partial %}
semaine avec jours non renseignés
{% endif %}
{% endif %} {# ── Zoom modal ── #} {% endblock %}