{% load i18n document_viewer_tags short_name %} {% comment %} Reusable document thumbnail grid + carousel viewer. Rendered by: common/templatetags/document_viewer_tags.py → render_document_viewer Context variables: docs – list of doc dicts, sorted by (tag.order, tag.name, doc.title) modal_id – HTML id for the viewer modal carousel_id – derived id for Bootstrap carousel thumbs_id – derived id for bottom strip download_id – derived id for download button fullpage_id – derived id for open-in-new-tab button allow_delete – show delete-overlay buttons (edit-mode) show_tags – show tag badge on thumbnails and in carousel caption show_versions – show version number + history button on thumbnails location_id – context-object PK emitted as data-location-id on history buttons {% endcomment %} {% if docs %} {% if not modal_only %} {# ═══════════════════════════ Thumbnail Grid ═══════════════════════════ #}
{{ doc.filename }}
{% if doc.attached_at or doc.attached_by or show_versions and doc.version_number %}{% if doc.attached_at %}{{ doc.attached_at|date:"d/m/Y" }}{% endif %}{% if doc.attached_by %} · {{ doc.attached_by|short_name }}{% endif %}{% if show_versions and doc.version_number %} · v{{ doc.version_number }}{% endif %}
{% endif %} {# History button without tag (no header) #} {% if show_versions and doc.tag_slug and not show_tags %} {% endif %}{% translate "Aucun document associé" %}
{% endif %}