{% extends 'base.html.twig' %} {% block title %}Offrande du jour – EOS{% endblock %} {% block body %}

Offrande du {{ today|date('d/m/Y') }}

{{ log ? '✏ Modifier' : '+ Saisir les métriques' }}
{% if log %} {# ── Barres de progression ── #} {% if log.targetCaloriesSnapshot > 0 or log.targetProteinsSnapshot > 0 %}
{% if log.targetCaloriesSnapshot > 0 %}
Plafond calorique
{{ log.caloriesConsumed ?? '–' }} / {{ log.targetCaloriesSnapshot }} kcal
{% if log.caloriesConsumed is not null %} {% set cpct = [100, (log.caloriesConsumed / log.targetCaloriesSnapshot * 100)|round]|min %} {% set isOver = log.caloriesConsumed > log.targetCaloriesSnapshot %}
{{ isOver ? 'Plafond dépassé' : 'Plafond respecté ✓' }}
{% endif %}
{% endif %} {% if log.targetProteinsSnapshot > 0 %}
Plancher protéique
{{ log.proteinsConsumed ?? '–' }} / {{ log.targetProteinsSnapshot }} g
{% if log.proteinsConsumed is not null %} {% set ppct = [100, (log.proteinsConsumed / log.targetProteinsSnapshot * 100)|round]|min %}
{% set protOk = log.proteinsConsumed >= log.targetProteinsSnapshot %}
{{ protOk ? 'Plancher atteint ✓' : 'Plancher non atteint' }}
{% endif %}
{% endif %}
{% endif %} {# ── Stats secondaires ── #}
{{ log.weight ? log.weight ~ ' kg' : '–' }}
Poids
{{ log.moodScore ?? '–' }}
Humeur 😊
{{ log.sleepScore ?? '–' }}
Sommeil 😴
{{ log.fatigueScore ?? '–' }}
Fatigue 😓
{# ── Activités ── #}

Activités sportives

{% if activityForm %} {% endif %}
{% set activities = log.activities %} {% if activities is not empty %} {% else %}

Aucune activité enregistrée pour aujourd'hui.

{% endif %} {# ── Formulaire ajout activité (caché par défaut via Stimulus) ── #} {% if activityForm %}
Nouvelle activité
{{ form_start(activityForm) }}
{{ form_row(activityForm.type) }}
{{ form_row(activityForm.durationMinutes) }}
{{ form_row(activityForm.caloriesBurned) }}
{{ form_row(activityForm.submit) }}
{{ form_end(activityForm) }}
{% endif %} {% else %}
🌅 Aucune offrande enregistrée pour aujourd'hui.
Saisir maintenant
{% endif %} {% endblock %}