{% extends 'mobile/mobile_base.html' %} {% load static %} {% load tz %} {% load controls_custom_filters %} {% load i18n %} {% block extra_head %} {% endblock extra_head %} {% block upleft %} {% endblock upleft %} {% block title %} {{ control.control_code }} {% endblock title %} {% block content %}
{% if messages %} {% for message in messages %} {% endfor %} {% endif %} {% if control.is_cancelled %}
{% translate "Contrôle annulé" %} — {% translate "Ce contrôle a été annulé." %}
{% endif %}
{% if can_cancel_control %} {% if control.is_cancelled %} {% else %} {% endif %} {% endif %} {% if can_change_control == True %}
{% endif %}

{% translate 'Statut' %} : {{ control.get_status_display }}

{% translate 'Type' %} : {{ control.get_control_type_display }}


{% if control.project %}

{% translate 'Projet' %} : {{ control.project.name }}

{% endif %} {% if control.phase %}

{% translate 'Phase' %} : {{ control.phase.name }}

{% endif %} {% if control.intervention %}

{% translate 'Intervention' %} : {{ control.intervention }}

{% endif %}

{% translate 'Lieu' %} : {{ control.location }}

{% translate 'Créé le' %} {{ control.created_at|timezone:"Europe/Paris"|date:"d/m/Y H:i" }} | {% translate 'Mis à jour le' %} {{ control.updated_at|timezone:"Europe/Paris"|date:"d/m/Y H:i" }}

{% translate 'Auteur' %} : {{ control.control_author }}

{% if control.description %}

{% translate 'Description' %} : {{ control.description }}

{% endif %} {% if control_photos_count > 0 %}
{% endif %}
{% for plan in plans %} {% endfor %} {% if plans %} {% endif %}

{% translate 'Ajouter une remarque' %}

{% csrf_token %} {{ qty_formset.management_form }}
{% translate 'Info' %} {% translate 'OK' %} {% translate 'NOK' %}

{{ remark_form.description }}


{% for category in categories %} {{ category.get_name }} {% endfor %}
{% translate 'Quantités liées à la remarque' %}
{% translate "Aucune quantité pour l'instant." %}
{% for form in qty_formset.forms %}
{{ form.as_p }}
{% endfor %}

{% translate 'Remarques' %}
{% for remark in remarks %}
{% if remark.status == "information" %}
{% elif remark.status == "to_be_processed" or remark.status == "processed" %} {% elif remark.status == "validated" %} {% endif %}
{{ remark.remark_number }}
{% if remark.images.exists %} {% endif %}
{{ remark.get_status_display }}

{% load short_name %} {% translate 'Mise à jour par' %} {{ remark.updated_by|short_name|default:remark.updated_by.username }} {% translate 'le' %} {{ remark.updated_at|timezone:"Europe/Paris"|date:"d/m/Y H:i" }}

{% translate "Suivis de la remarque" %} :
{% for entry in remark.history.all %}
📅 {{ entry.created_at|timezone:"Europe/Paris"|date:"d/m/Y H:i" }} {{ entry.get_status_display }} ({% translate 'par' %} {{ entry.created_by|short_name|default:entry.created_by.username }})
{% if entry.description %}
{{ entry.description }}
{% endif %}
{% for image in entry.images.all %}
{% private_file_url image 'file' as image_file_url %} {% private_file_url image 'thumbnail' as image_thumb_url %} {% translate 'Image de la remarque' %} {% if can_change_control %} {% endif %}
{% endfor %}
{% empty %}
📅 {{ remark.created_at|timezone:"Europe/Paris"|date:"d/m/Y H:i" }} {{ remark.get_status_display }} ({% translate 'par' %} {{ remark.updated_by|short_name|default:remark.updated_by.username }})
{% if remark.description %}
{{ remark.description }}
{% endif %}
{% for image in remark.images.all %} {% if not image.history_entry %}
{% private_file_url image 'file' as image_file_url %} {% private_file_url image 'thumbnail' as image_thumb_url %} {% translate 'Image de la remarque' %} {% if can_change_control %} {% endif %}
{% endif %} {% endfor %}
{% endfor %}
{% for tag in remark.remark_tags.all %} {{ tag.category.get_name }} {% endfor %}
{% get_current_language as LANGUAGE_CODE %} {% with qty_list=remark.quantities.all %} {% if qty_list %}
{% translate 'Quantités' %}
{% for q in qty_list %} {% endfor %}
{% translate 'Poste / Description' %} {% translate 'Total' %}
{% if q.contract_post %}
{{ q.contract_post.code }} {% if q.contract_post.unit %}({{ q.contract_post.unit }}){% endif %}
{% if LANGUAGE_CODE|slice:":2" == "nl" %} {{ q.contract_post.description_nl|default:q.contract_post.description_fr|truncatechars:120 }} {% else %} {{ q.contract_post.description_fr|default:q.contract_post.description_nl|truncatechars:120 }} {% endif %}
{% if q.contract %}
{{ q.contract.contract_number }}
{% endif %} {% else %}
{{ q.description|default:"—" }}
{% endif %}
{{ q.computed_qty|floatformat:2 }}
{% endif %} {% endwith %} {% if not forloop.last %}
{% endif %}
{% empty %}

{% translate 'Aucune remarque enregistrée.' %}

{% endfor %}

{% translate 'Rapports' %}
{% for report in reports %}
  • 📅 {% translate 'Généré le' %} : {{ report.created_at|timezone:"Europe/Paris"|date:"d/m/Y H:i" }}
    🖊 {% translate 'Auteur' %} : {{ report.created_by }}
    {% private_file_url report 'document' as report_document_url %} 📥 {% translate 'Télécharger' %}
  • {% if not forloop.last %}
    {% endif %} {% empty %}

    {% translate 'Aucun rapport sauvegardé.' %}

    {% endfor %}
    {% if report_template %}
    {% translate 'Template' %}
    {% endif %}
    {% translate 'Archives' %}
    {% for remark in archives %}
    {{ remark.remark_number }}
    {{ remark.get_status_display }}
    {{ remark.description }}

    {% translate 'Mise à jour par' %} {{ remark.updated_by.username }} {% translate 'le' %} {{ remark.updated_at|timezone:"Europe/Paris"|date:"d/m/Y H:i" }}

    {% for image in remark.images.all %} {% private_file_url image 'file' as image_file_url %} {% private_file_url image 'thumbnail' as image_thumb_url %}
    {% translate 'Image de la remarque' %} {% if can_change_control %} {% endif %}
    {% endfor %}
    {% for tag in remark.remark_tags.all %} {{ tag.category.get_name }} {% endfor %}
    {% if not forloop.last %}
    {% endif %}
    {% endfor %}



    {% translate 'Ajouter un Plan de Référence' %}

    {% csrf_token %}
    {{ upload_plan_form.name }}
    {{ upload_plan_form.plan }}
    {% translate 'Hors ligne' %} 0 {% translate 'en attente' %}
    {% endblock content %} {% block extra_scripts %} {{ plans_data|json_script:"plans-data" }} {{ remarks_data|json_script:"remarks-data" }} {% endblock extra_scripts %}