{# templates/admin/technique/_partials/_evolution_details.html.twig #} {# 1. Préparation des variables de contexte #} {% set projetNom = (type == 'PROJET') ? target.nom : (target.projet.nom|default('Projet non défini')) %} {% set lotNom = (type == 'LOT') ? target.nomBien : '' %}
{# BANDEAU RÉCAPITULATIF (GLOBAL) #}
{{ type == 'PROJET' ? 'Programme Immobilier' : 'Détail du Lot' }}
{{ (type == 'PROJET') ? target.nom : target.nomBien }}
{% if type == 'LOT' %} Lot n°{{ target.numeroLot }} • {{ target.typeBien.libelle|default('Type NC') }} {% endif %}
{{ target.avancement|default(0) }}%
Avancement Global
{# SECTION DOCUMENTS DU PROJET OU DU LOT #}
{{ type == 'PROJET' ? 'Fichiers Programme' : 'Fichiers Lot' }}
{# BADGE POUR LES DOCUMENTS #} {{ render(path('shared_doc_badge', { 'targetType': type ~ '_DOC', 'targetId': target.id, 'color': 'bg-success', 'label': 'Docs', 'icon': 'fa-file-pdf', 'projetNom': projetNom, 'lotNom': lotNom })) }} {# BADGE POUR LES IMAGES #} {{ render(path('shared_doc_badge', { 'targetType': type ~ '_IMG', 'targetId': target.id, 'color': 'bg-info', 'label': 'Photos', 'icon': 'fa-camera', 'projetNom': projetNom, 'lotNom': lotNom })) }}
{# SECTION ÉTAPES TECHNIQUES (Seulement pour les LOTS) #} {% if type == 'LOT' %}
Progression des Étapes
{% for etape in target.lotEtapes %} {% set progress = etape.pourcentageAvancement|default(0) %} {% set colorClass = progress >= 100 ? 'success' : (progress >= 50 ? 'warning' : (progress > 0 ? 'primary' : 'danger')) %}
{{ etape.libelle }}
{# Badge pour les documents de l'étape #} {{ render(path('shared_doc_badge', { 'targetType': 'ETAPE_DOC', 'targetId': etape.id, 'color': 'bg-danger', 'label': 'Docs', 'icon': 'fa-file-pdf', 'projetNom': projetNom, 'lotNom': lotNom, 'etapeNom': etape.libelle })) }} {# Badge pour les photos de l'étape #} {{ render(path('shared_doc_badge', { 'targetType': 'ETAPE_IMG', 'targetId': etape.id, 'color': 'bg-warning', 'label': 'Photos', 'icon': 'fa-camera', 'projetNom': projetNom, 'lotNom': lotNom, 'etapeNom': etape.libelle })) }}
%
{% else %}

Aucune étape technique définie pour ce lot.

{% endfor %}
{% else %}
Vue d'ensemble du programme.
Les étapes de chantier se gèrent lot par lot dans la colonne centrale.
{% endif %}