{% extends 'base.html.twig' %} {% block title %}Nouvel entretien — {{ car.getDisplayName() }}{% endblock %} {% block content %} {# ── En-tête ── #}

Nouvel entretien

{{ car.getDisplayName() }}

Retour
Informations de l'entretien
{{ form_start(form, {attr: { novalidate: 'novalidate', id: 'maintenance-form', 'data-controller': 'maintenance-form', 'data-maintenance-form-insurance-label-value': 'Assurance', 'data-maintenance-form-ct-label-value': 'Contrôle technique' }}) }} {# ── Bannière erreurs globales ── #} {% set formErrors = form_errors(form) %} {% if formErrors is not empty %} {% endif %} {# Type d'entretien #}
{{ form_widget(form.typeLabel, {attr: { class: 'form-select form-select-lg' ~ (form.typeLabel.vars.errors|length ? ' is-invalid' : ''), 'data-maintenance-form-target': 'typeSelect', 'data-action': 'change->maintenance-form#onTypeChange' }}) }} {{ form_errors(form.typeLabel) }}
{# Date & Coût & dates conditionnelles — grille #}
{# Date d'intervention #}
{{ form_widget(form.performedAt, {attr: { class: 'form-control' ~ (form.performedAt.vars.errors|length ? ' is-invalid' : '') }}) }} {{ form_errors(form.performedAt) }}
{# Coût #}
{{ form_widget(form.cost, {attr: { class: 'form-control' ~ (form.cost.vars.errors|length ? ' is-invalid' : '') }}) }} MAD
{{ form_errors(form.cost) }}
{# Date expiration Assurance (conditionnelle) #} {# Date prochain CT (conditionnelle) #}
{# Kilométrage #}
{{ form_widget(form.mileageAtService, {attr: { class: 'form-control' ~ (form.mileageAtService.vars.errors|length ? ' is-invalid' : ''), placeholder: 'Ex : 45 000' }}) }} km
{{ form_errors(form.mileageAtService) }}
{# Description #}
{{ form_widget(form.description, {attr: { class: 'form-control' ~ (form.description.vars.errors|length ? ' is-invalid' : ''), rows: 3, placeholder: 'Détails optionnels, références de pièces, prestataire…' }}) }} {{ form_errors(form.description) }}
{# Boutons #}
Annuler
{{ form_end(form) }}
{% endblock %}