{% extends "base.html" %} {% load static %} {% load i18n %} {% load l10n %} {% load short_name %} {% load document_viewer_tags %} {% block head %} {{ finding.code }} — {% translate "Constat" %} {% endblock head %} {% block content %}
{% if messages %} {% for message in messages %} {% endfor %} {% endif %} {% if warranty_alert %} {% endif %}

{{ finding.code }}

{{ finding.get_status_display }} {{ finding.get_severity_display }} {{ finding.get_finding_nature_display }} {{ finding.get_tracking_scope_display }} {{ finding.get_visibility_display }} {% if finding.is_safety_hazard %} {% translate "Danger immédiat" %} {% endif %}
{% if can_edit %} {% translate "Modifier" %} {% endif %} {% if can_process %} {% endif %}
{# Colonne gauche : détails + évolution 1-tap + timeline #}
{{ finding.title|default:finding.code }}
{% if finding.description %}

{{ finding.description|linebreaksbr }}

{% endif %}
{% translate "Thématique" %} : {{ finding.thematic|default:"-" }}
{% translate "Catégorie" %} : {{ finding.category|default:"-" }}
{% translate "Symptôme" %} : {{ finding.symptom|default:"-" }}
{% translate "Adresse" %} : {{ finding.address|default:"-" }}
{% if latest_visit %}
{% translate "Dernière visite" %} : {% if latest_visit_url %} {{ latest_visit.code }} {% else %} {{ latest_visit.code }} {% endif %} {% if latest_visit.conducted_at %} ({{ latest_visit.conducted_at|date:"d/m/Y" }}) {% endif %}
{% endif %} {% if finding.measured_value is not None %}
{% translate "Mesure" %} : {{ finding.measured_value }} {{ finding.measured_unit }}
{% endif %} {% if finding.planned_in_project %}
{% translate "Alloti dans le projet" %} : {{ finding.planned_in_project.code }} — {{ finding.planned_in_project.name }}
{% endif %} {% if finding.merged_into %}
{% translate "Fusionné dans" %} : {{ finding.merged_into.code }}
{% endif %}
{# Actions d'évolution 1-tap + ajout de documents / caméra continue #} {% if can_evolve_basic %}
{% translate "Évolution rapide (1-tap)" %}
{% csrf_token %}
{% if can_resolve %} {% endif %}
{% endif %} {# Timeline chronologique avec documents & photos intégrés #}
{% translate "Chronologie des relevés" %} ({{ entries|length }})
{% for entry in entries %}
{{ entry.get_entry_type_display }} {{ entry.recorded_at|date:"d/m/Y H:i" }}
{% if entry.created_by %}{{ entry.created_by|short_name }} · {% endif %} {{ entry.get_status_snapshot_display }} {% if entry.visit %} · {% translate "Visite" %} {% if entry.visit_url %}{{ entry.visit.code }}{% else %}{{ entry.visit.code }}{% endif %}{% endif %}
{% if entry.description %}
{{ entry.description|linebreaksbr }}
{% endif %} {% if entry.viewer_docs %}
{% render_document_viewer entry.viewer_docs modal_id="findingDocViewerModal" grid_only=True compact_thumbs=True %}
{% endif %}
{% empty %}
{% translate "Aucun relevé enregistré." %}
{% endfor %}
{# Colonne droite : carte / plan / photos / interventions / métrés #}
{% if geom_geojson %}
{% translate "Carte" %}
{% endif %} {% if reference_view_url %}
{% translate "Plan de repérage" %} : {{ finding.reference_view.name }}
{{ finding.reference_view.name }} {% if plan_u_pct is not None and plan_v_pct is not None %} {% endif %}
{% endif %}
{% translate "Interventions liées" %} ({{ visible_interventions|length }})
{% for item in visible_interventions %}
{{ item.intervention.code }} {% if item.is_primary %}{% translate "Principale" %}{% endif %}
{{ item.intervention.title }}
{{ item.intervention.get_status_display }}
{% empty %}
{% translate "Aucune intervention liée." %}
{% endfor %}
{% if all_sequenced_media %}
{% translate "Médias & Documents" %} ({{ all_sequenced_media|length }})
{% render_document_viewer all_sequenced_media modal_id="findingDocViewerModal" grid_only=True compact_thumbs=True %}
{% endif %} {% if quantities %}
{% translate "Métrés" %}
{% for q in quantities %} {% endfor %}
{% translate "Libellé" %}{% translate "Quantité" %}
{{ q.description|default:"-" }}{{ q.computed_qty }}
{% endif %}
{# Modale doublons détectés (< 30m) #} {# Modale Lier à une intervention existante #} {# Modale Allotir vers un Projet #} {# Modale Fusionner doublon #} {% if all_sequenced_media %} {% render_document_viewer all_sequenced_media modal_id="findingDocViewerModal" modal_only=True %} {% endif %} {% if can_evolve_basic %} {% include "findings/_camera_modal.html" %} {% endif %} {% endblock content %} {% block script %} {% endblock script %}