{% extends "base.html" %}
{% block title %}{{ title }} — GMAO{% endblock %}

{% block content %}

<div class="container-fluid">
    <h1 class="mb-4">{{ title }}</h1>
    
    <div class="card">
        <div class="card-body">
            <form method="POST">
                {{ form.hidden_tag() }}
                <div class="row">
                    <div class="col-md-6 mb-3">{{ form.name.label(class="form-label") }} {{ form.name(class="form-control") }}</div>
                    <div class="col-md-6 mb-3">{{ form.location.label(class="form-label") }} {{ form.location(class="form-control") }}</div>
                </div>
                <div class="row">
                    <div class="col-md-4 mb-3">{{ form.start_date.label(class="form-label") }} {{ form.start_date(class="form-control") }}</div>
                    <div class="col-md-4 mb-3">{{ form.end_date.label(class="form-label") }} {{ form.end_date(class="form-control") }}</div>
                    <div class="col-md-4 mb-3">{{ form.max_participants.label(class="form-label") }} {{ form.max_participants(class="form-control") }}</div>
                </div>
                <div class="mb-3">{{ form.description.label(class="form-label") }} {{ form.description(class="form-control", rows=3) }}</div>
                <button type="submit" class="btn btn-success"><i class="bi bi-check-lg"></i> Enregistrer</button>
                <a href="{{ url_for('trainings.index') }}" class="btn btn-secondary">Annuler</a>
            </form>
        </div>
    </div>
</div>

{% endblock %}