{% extends "base.html" %} {% load static %} {% load i18n %} {% load short_name %} {% load projects_tags %} {% load document_viewer_tags %} {% block head %} {% endblock head %} {% block content %}
{% if is_edit_allowed %}
{% endif %}

{% translate "Projet" %} - {{ project.code }} - {{ project.name }}

{% for thematic in project.thematics.all %} {{ thematic.name }} {% empty %} {% translate "Aucune thématique" %} {% endfor %} {% if project.begin_time %} {{ project.start_date|date:"d-m-Y" }}
{% endif %} {% if project.end_time %} {{ project.end_date|date:"d-m-Y" }}
{% endif %}

{{ project.start_date|date:"d-m-Y"|default:"..." }} {{ project.end_date|date:"d-m-Y"|default:"..." }}


{{ project.description }}

{% if project.pmo_number %} {{ project.pmo_number }} {% endif %}

{% if project.osiris_number %} {{ project.osiris_number }} {% endif %}

{% translate "Documents" %}

{% if can_add_documents %} {% endif %}
{% if can_browse_folder and document_folder %} {% endif %}
{% if use_managed_documents %} {# Nouveau système : visionneuse réutilisable avec tags + versioning #} {% render_document_viewer project_documents modal_id="projectDocViewerModal" show_tags=True show_versions=True location_id=project.id %} {% else %} {# Système hérité ProjectDocument #}
{% for document in project.documents.all %} {% private_file_url document 'file' as doc_file_url %} {% private_file_url document 'thumbnail' as doc_thumb_url %}
{% if can_add_documents %} {% endif %}
{% if document.thumbnail %} {{ document.filename }} {% else %} {{ document.filename }} {% endif %}
{{ document.upload_date|date:"d/m/Y H:i" }}
{% if document.uploaded_by %}{{ document.uploaded_by|short_name }}{% endif %}
{% endfor %}
{% endif %}
{% if can_add_documents %} {% endif %} {# Config JSON pour le JS du formulaire d'ajout #}

{% translate "Tags" %}

{% if is_edit_allowed %} {% endif %}
{% if is_edit_allowed %}
{% csrf_token %}
{% endif %}
{% for tag in project.tags.all %}
{{ tag.name }} {% if is_edit_allowed %}
{% csrf_token %}
{% endif %}
{% empty %}

{% translate "Aucun tag associé" %}

{% endfor %}
{% if project_templates or available_templates %}

{% translate "Attributs supplémentaires" %}

{% if is_edit_allowed and available_templates %} {% endif %}
{% if is_edit_allowed and available_templates %}
{% csrf_token %}
{% endif %}
{% if not project_templates %}

{% translate "Aucun template associé" %}

{% endif %} {% for tpl_data in project_templates %}
{{ tpl_data.template.name }}
{% if is_edit_allowed %}
{% csrf_token %}
{% endif %}
{# Read-only view #}
{% if not tpl_data.attributes %}

{% translate "Aucun attribut défini pour ce template." %}

{% else %} {% for item in tpl_data.attributes %} {% endfor %}
{{ item.attr.name }} {% if item.attr.is_required %}*{% endif %} {% if item.value %} {{ item.value.display_value }} {% else %} — {% endif %}
{% endif %}
{# Edit form (hidden by default) #} {% if is_edit_allowed %}
{% for item in tpl_data.attributes %}
{% if item.attr.help_text %}
{{ item.attr.help_text }}
{% endif %} {% if item.attr.attribute_type == 'text' %} {% elif item.attr.attribute_type == 'number' %} {% elif item.attr.attribute_type == 'boolean' %}
{% with cur=item.value.value_boolean %} {% endwith %}
{% elif item.attr.attribute_type == 'choice' %} {% elif item.attr.attribute_type == 'choice_multiple' %}
{% with cur=item.value.value_choices|default:'' %} {% for ch in item.choices %} {% endfor %} {% endwith %}
{% elif item.attr.attribute_type == 'date' %} {% endif %}
{% endfor %}
{% endif %}
{% if not forloop.last %}
{% endif %} {% endfor %}
{% endif %}

{% translate "Phases" %}

{% if is_edit_allowed %} {% endif %}
{% if project.phases.all %} {% for phase in project.phases.all %}
{{ phase.name }}
{% if phase.start_date and phase.end_date %} {{ phase.start_date|date:"d-m-Y" }} - {{ phase.end_date|date:"d-m-Y" }}
{% endif %} {% if phase.contract %} {% translate "Contrat" %}: {{ phase.contract.contract_number }}
{% endif %} {% if phase.description %}
{{ phase.description|safe }}
{% endif %}
{% if is_edit_allowed %} {% endif %}
{% endfor %} {% else %}

{% translate "Aucune phase définie pour ce projet." %}

{% endif %}

{% translate "Interventions" %}

{% if can_add_interventions %} {% endif %}
{% for interv in interventions %} {% with intervention=interv.intervention %} {% endwith %} {% endfor %}
{% translate "Résumé" %} {% translate "Code" %} {% translate "Titre" %} {% translate "Début" %} {% translate "Statut" %}
{% if interv.can_view_summary %} {% endif %} {% if interv.can_view %} {{ intervention.code }} {% else %} {{ intervention.code }} {% endif %} {{ intervention.title }} {{ intervention.begin_time|date:"d-m-Y H:i" }} {{ intervention.get_status_display }}

{% translate "Commandes" %}

{% if can_manage_orders %}
{% endif %}
{% if orders %} {% for order in orders %} {% endfor %}
{% translate "Code" %} {% translate "Contrat" %} {% translate "Date de commande" %} {% translate "Date de livraison" %} {% translate "Montant total" %} {% translate "Statut" %}
{{ order.order_code }} {{ order.contract.contract_number }} {{ order.order_date|date:"d-m-Y" }} {{ order.delivery_date|date:"d-m-Y" }} {{ order.total_amount|floatformat:2 }} € {{ order.get_order_status_display }} {% if can_manage_orders %} {% endif %}
{% else %} {% endif %}

{% translate "Rapports de suivi" %}

{% if can_add_controls %} {% endif %}
{% for control in project.controls.all %} {% endfor %}
{% translate "Code" %} {% translate "Date" %} {% translate "Type" %} {% translate "Statut" %} {% translate "Auteur" %}
{{ control.control_code }} {{ control.updated_at|date:"d-m-Y H:i" }} {{ control.get_control_type_display }} {{ control.get_control_status_display }} {{ control.control_author|short_name }}
{% if can_manage_members %}

{% translate "Permissions spécifiques" %}

{% if can_manage_members %} {% endif %}
{% for m in members %}
{{ m.user|short_name }}{% if m.can_edit %} - {% translate "Éditeur" %}{% endif %} {% if can_manage_members %} {% endif %}
{% endfor %} {% for ta in team_accesses %}
{{ ta.team.name }} ({{ ta.team.company.name }}){% if ta.can_edit %} - {% translate "Éditeur" %}{% endif %} {% if can_manage_members %} {% endif %}
{% endfor %}
{% endif %} {% if can_manage_members %} {% endif %} {% if can_manage_members %} {% endif %}
{% endblock content%} {% block script %} {{ project.lon|json_script:"lon_value" }} {{ project.lat|json_script:"lat_value" }} {{ status_choices|json_script:"status_choices" }} {{ teams_list|json_script:"teams_list_data" }} {% endblock script %}