{% extends "documents/base_documents.html" %} {% load i18n documents_tags static %} {% load short_name %} {% block head %} {{ block.super }} {% endblock head %} {% block content %}

{{ document.title }}

{% if can_edit_document %} {% endif %}

{{ document.description|default:_("No description provided") }}

{% if can_edit_document %} {% endif %} {% if document.georeference_coords %} {% translate "Afficher sur la carte" %} {% endif %} {% if is_ifc or document.get_file_extension.lower == '.ifc' %} {% translate "Visualiser la maquette 3D (BIM)" %} {% endif %} {% if is_dxf and intersection %} {% translate "Importer les couches vectorielles" %} {% endif %} {% if can_edit_document and document.latest_version %} {% endif %} {% if can_delete_document %} {% translate "Delete" %} {% endif %}
{# ── Row 1 : Version actuelle | Dossiers | Tags ── #}
{% if document.latest_version %} {% private_file_url document.latest_version 'file' as latest_version_url %}
{% translate "Current version" %}

v{{ document.latest_version.version_number }} – {{ document.latest_version.upload_date|date:"SHORT_DATETIME_FORMAT" }} {% if document.latest_version.uploaded_by %} – {{ document.latest_version.uploaded_by|short_name }} {% endif %}

{% if latest_version_url %} {% endif %}
{% endif %}
{% translate "Folders" %}
{% if can_edit_document %} {% endif %}
{% if can_edit_document %}
{% csrf_token %}
{% endif %}
{% for folder in document.folders.all %}
{{ folder.name }} {% with parents=folder.parent_folders.all %} {% if parents %} {% translate "Parents" %}: {{ parents|join:', ' }} {% endif %} {% endwith %} {% if can_edit_document %}
{% csrf_token %}
{% endif %}
{% empty %}

{% translate "No folder associated" %}

{% endfor %}
{% translate "Tags" %}
{% if can_edit_document %} {% endif %}
{% if can_edit_document %}
{% csrf_token %}
{% endif %}
{% for tag in document.tags.all %}
{{ tag.name }} {% if can_edit_document %}
{% csrf_token %}
{% endif %}
{% empty %}

{% translate "No tag associated" %}

{% endfor %}
{# ── Row 2 : Historique des versions | Prévisualisation ── #}
{% translate "Version history" %}
{% csrf_token %}
{{ version_form.file }}
{{ version_form.comment }}
{% if version_form.errors %}
{{ version_form.errors }}
{% endif %}
    {% for version in document.versions.all %} {% private_file_url version 'file' as version_file_url %}
  • {% if version_file_url %} v{{ version.version_number }} {% else %} v{{ version.version_number }} {% endif %}
    {{ version.upload_date|date:"SHORT_DATETIME_FORMAT" }} {% if version.uploaded_by %} {{ version.uploaded_by|short_name }}{% endif %} {% if version.comment %}

    {{ version.comment }}

    {% endif %}
    {% if version_file_url %} {% endif %} {% if can_edit_document %}
    {% csrf_token %}
    {% endif %}
    {% with validations=version.validations.all %} {% if validations %}
    {% translate "Validations" %}
    {% for validation in validations %} {% with form=validation_forms|get_item:validation.id %}
    {% csrf_token %}
    {{ validation.role.name }}
    {{ validation.get_status_display }}
    {{ form.status }}
    {{ form.comment }}
    {% endwith %} {% endfor %}
    {% endif %} {% endwith %}
  • {% empty %}
  • {% translate "No versions yet." %}
  • {% endfor %}
{% translate "Document preview" %}
{% if document.latest_version %} {% private_file_url document.latest_version 'file' as latest_version_url %} {% if latest_version_url %} {% endif %} {% endif %}
{% if preview_mime_type %} {% private_file_url document.latest_version 'file' as preview_url %} {% if is_preview_pdf %}
{% elif is_preview_image %} {% translate 'Document preview' %} {% endif %} {% elif is_preview_text %}
{{ preview_text }}
{% if preview_truncated %}

{% translate "File truncated to the first 50 000 characters." %}

{% endif %} {% elif is_preview_tabular %} {% if preview_rows %}
{% for cell in preview_rows.0 %}{% endfor %} {% for row in preview_rows|slice:"1:" %} {% for cell in row %}{% endfor %} {% endfor %}
{{ cell }}
{{ cell }}
{% if preview_truncated %}

{% translate "Only the first 200 rows are shown." %}

{% endif %} {% else %}

{% translate "Empty file." %}

{% endif %} {% elif document.latest_version %}

{% translate "Preview is not available for this file type." %}

{% else %}

{% translate "No version available yet." %}

{% endif %}
{% translate "Linked items" %}
{% csrf_token %} {% if attachment_form.non_field_errors %}
{{ attachment_form.non_field_errors }}
{% endif %}
{{ attachment_form.content_type }} {% if attachment_form.content_type.errors %}
{{ attachment_form.content_type.errors }}
{% endif %}
{{ attachment_form.object_id }} {% if attachment_form.object_id.errors %}
{{ attachment_form.object_id.errors }}
{% endif %}
{{ attachment_form.note }} {% if attachment_form.note.errors %}
{{ attachment_form.note.errors }}
{% endif %}
    {% for attachment in document.attachments.all %}
  • {% if attachment.content_object.get_absolute_url %} {{ attachment.content_object }} {% else %} {{ attachment.content_object }} {% endif %}
    {% csrf_token %}
  • {% empty %}
  • {% translate "No link yet" %}
  • {% endfor %}
{% translate "Shares" %}
{% csrf_token %} {% if share_form.non_field_errors %}
{{ share_form.non_field_errors }}
{% endif %}
{{ share_form.user }} {% if share_form.user.errors %}
{{ share_form.user.errors }}
{% endif %}
{{ share_form.permission }} {% if share_form.permission.errors %}
{{ share_form.permission.errors }}
{% endif %}
    {% for share in document.shares.all %}
  • {{ share.user.get_full_name|default:share.user.username }} – {{ share.get_permission_display }}
    {% csrf_token %}
  • {% empty %}
  • {% translate "No share yet" %}
  • {% endfor %}
{% translate "Shareable links" %}
{% csrf_token %} {% if access_link_form.non_field_errors %}
{{ access_link_form.non_field_errors }}
{% endif %}
{{ access_link_form.permission }} {% if access_link_form.permission.errors %}
{{ access_link_form.permission.errors }}
{% endif %}
{{ access_link_form.expires_at }} {% if access_link_form.expires_at.errors %}
{{ access_link_form.expires_at.errors }}
{% endif %}
    {% for link in document.access_links.all %}
  • {{ link.token }}
    {{ link.get_permission_display }}{% if link.expires_at %} – {{ link.expires_at|date:"SHORT_DATETIME_FORMAT" }}{% endif %}
    {% csrf_token %}
  • {% empty %}
  • {% translate "No shareable link" %}
  • {% endfor %}
{% if can_edit_document %} {% endif %} {% endblock content %} {% block script %} {{ block.super }} {% endblock script %}