{% load document_viewer_tags i18n interventions_tags short_name tz %}

{% translate "Notes et documents" %} {% if total_items_count %} {{ total_documents_count }} {% if total_documents_count > 1 %}{% translate "docs" %}{% else %}{% translate "doc" %}{% endif %} • {{ total_notes_count }} {% if total_notes_count > 1 %}{% translate "notes" %}{% else %}{% translate "note" %}{% endif %} {% endif %} {% if photos_required %} {% translate "Photos obligatoires" %} {% endif %}

{% if can_edit_notes %} {% endif %} {% if 'documents' in allowed_update_fields %} {% endif %}
{% if can_edit_notes %} {% endif %}
{% if total_items_count == 0 %}

{% translate "Aucun document ou note pour cette intervention." %}

{% else %} {% for block in sequenced_blocks %} {% if block.has_items %}
{{ block.title }} {% if block.documents_count > 0 %}{{ block.documents_count }} {% if block.documents_count > 1 %}{% translate "fichiers" %}{% else %}{% translate "fichier" %}{% endif %}{% endif %} {% if block.documents_count > 0 and block.notes_count > 0 %}•{% endif %} {% if block.notes_count > 0 %}{{ block.notes_count }} {% if block.notes_count > 1 %}{% translate "notes" %}{% else %}{% translate "note" %}{% endif %}{% endif %}
{% if block.period_display %} {{ block.period_display }} {% endif %}
{% if block.documents %}
{% render_document_viewer block.documents modal_id="interventionDocViewerModal" grid_only=True allow_delete=can_delete_documents delete_always_visible=can_delete_documents allow_copy=can_copy_documents %}
{% endif %} {% if block.notes %}
{% for note in block.notes %}
{{ note.get_note_type_display }}

{{ note.content|linebreaksbr }}

{% if note.id in editable_note_ids %}
{% endif %}
{% if note.id in editable_note_ids %} {% endif %}
{% endfor %}
{% endif %}
{% endif %} {% endfor %} {% endif %} {% if all_sequenced_documents %} {% render_document_viewer all_sequenced_documents modal_id="interventionDocViewerModal" modal_only=True allow_delete=can_delete_documents delete_always_visible=can_delete_documents allow_copy=can_copy_documents %} {% endif %}
{% if 'documents' in allowed_update_fields %} {# ── Copy-document modal ── #} {# Copy-targets JSON for JS #} {% endif %}