{% extends 'nutrition/base.html' %}

{% block title %}Ajouter un repas - Carb Cycling{% endblock %}

{% block content %}
<div class="row justify-content-center">
    <div class="col-md-6">
        <div class="card">
            <div class="card-header bg-success text-white">
                <h4 class="mb-0">
                    <i class="bi bi-plus-circle"></i> Ajouter un repas
                </h4>
            </div>
            <div class="card-body">
                <p class="mb-4">
                    <strong>Journée :</strong> {{ journee.date|date:"l d F Y" }}<br>
                    <span class="badge badge-{{ journee.type_journee }}">
                        {{ journee.get_type_journee_display }}
                    </span>
                </p>
                
                <form method="post">
                    {% csrf_token %}
                    
                    <div class="mb-3">
                        <label for="{{ form.type_repas.id_for_label }}" class="form-label fw-bold">
                            Type de repas
                        </label>
                        {{ form.type_repas }}
                    </div>
                    
                    <div class="mb-3">
                        <label for="{{ form.heure.id_for_label }}" class="form-label">
                            Heure (optionnel)
                        </label>
                        {{ form.heure }}
                    </div>
                    
                    <div class="mb-3">
                        <label for="{{ form.notes.id_for_label }}" class="form-label">
                            Notes (optionnel)
                        </label>
                        {{ form.notes }}
                    </div>
                    
                    <div class="d-flex justify-content-between">
                        <a href="{% url 'detail_journee' journee.pk %}" class="btn btn-outline-secondary">
                            <i class="bi bi-x-circle"></i> Annuler
                        </a>
                        <button type="submit" class="btn btn-success">
                            <i class="bi bi-check-circle"></i> Créer le repas
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %}
