{# templates/entreprise/location/edit.html.twig #} {% extends 'entreprise/entreprise_base.html.twig' %} {% block title %}Modifier le Contrat | {{ location.locataire.nom }}{% endblock %} {% block body %}
{# --- EN-TÊTE HARMONISÉ --- #}

Appartement : {{ location.appartement.titre }} | Locataire : {{ location.locataire.nom }} {{ location.locataire.prenom }}

Retour à la liste
{% include 'flash_messages.html.twig' %}
{# --- BLOC PRINCIPAL : FORMULAIRE --- #}
{{ include('entreprise/location/_form.html.twig', { 'button_label': 'Mettre à jour le contrat', 'button_class': 'btn btn-info text-white px-5 shadow-sm fw-bold' }) }}
{# --- SIDEBAR : ACTIONS DE GESTION --- #}
{% if is_granted('ROLE_ENTREPRISE_COLLAB') %} {# 1. Clôture du Contrat #}
Fin de location
{% if location.dateFin is not null %}
Clôturé le {{ location.dateFin|date('d/m/Y') }}

Ce contrat est arrivé à son terme officiel.

{% else %}

Utilisez cette action uniquement si le locataire quitte l'Appartement.

{% endif %}
{# 2. Zone de danger (Suppression) #} {% if is_granted('ROLE_ENTREPRISE_ROOT') %}
Zone d'administration

La suppression est irréversible. À utiliser uniquement en cas d'erreur de saisie totale.

{{ include('entreprise/location/_delete_form.html.twig', {'location': location}) }}
{% endif %} {% else %}
Vous ne disposez pas des droits suffisants pour clôturer ou supprimer ce contrat.
{% endif %}
{% endblock %} {% block javascripts %} {{ parent() }} {% endblock %}