{% extends "mobile/mobile_base.html" %} {% load static %} {% load i18n %} {% load observation_tags %} {% load short_name %} {% load mention_tags %} {% block extra_head %} {% endblock extra_head %} {% block upleft %} {% endblock upleft %} {% block title %} {% translate "Détail observation" %} {% endblock title %} {% block content %}
{% translate "Actions" %}
{% if observation.status == 'to_process' %} {% if can_take_action %}
{% if observation.observation_type == 'inventory' or observation.observation_type == 'remark' %} {% else %}
{% csrf_token %}
{% endif %} {% if not observation.intervention %} {% endif %} {% if not observation.project %} {% endif %}
{% endif %} {% endif %} {% if observation.status == 'in_preparation' or not observation.status %}
{% csrf_token %}
{% endif %} {% if observation.status == 'processed' or observation.status == 'not_relevant' or observation.status == 'to_redirect' or observation.status == 'duplicate' %} {% if 'admin' in user_roles or 'operator' in user_roles or 'manager' in user_roles or 'controller' in user_roles %}
{% csrf_token %}
{% endif %} {% endif %}
{{ observation.code }} {% if can_edit or can_delete %} {% if can_edit %} {% if observation.status == 'in_preparation' or observation.status == 'to_process' or observation.status == 'to_redirect' %} {% translate "Modifier" %} {% endif %} {% endif %} {% if can_delete %} {% endif %} {% endif %}
{% if observation.observation_type == 'incident' %}{% else %}{% endif %} {{ observation.get_observation_type_display }} {% if observation.status == 'in_preparation' %} {{ observation.get_status_display }} {% elif observation.status == 'to_process' %} {{ observation.get_status_display }} {% elif observation.status == 'in_progress' %} {{ observation.get_status_display }} {% elif observation.status == 'processed' %} {{ observation.get_status_display }} {% elif observation.status == 'not_relevant' %} {{ observation.get_status_display }} {% elif observation.status == 'to_redirect' %} {{ observation.get_status_display }} {% elif observation.status == 'duplicate' %} {{ observation.get_status_display }} {% elif observation.status == 'closed' %} {{ observation.get_status_display }} {% elif observation.status == 'archived' %} {{ observation.get_status_display }} {% endif %}
{% translate "Thématique" %}
{% if observation.thematic %} {{ observation.thematic.name }} {% else %}

-

{% endif %}
{% translate "Catégorie" %}
{% if observation.category %} {% if observation.category.parent %}{{ observation.category.parent.get_name }} — {% endif %}{{ observation.category.get_name }} {% else %}

-

{% endif %}
{% translate "Description" %}

{{ observation.description|default:"-" }}

{% if observation.address %}
{% translate "Adresse" %}

{{ observation.address }}

{% endif %}
{% translate "Créé le" %}

{{ observation.created_at|date:"d/m/Y H:i" }}

{% translate "Créé par" %}

{% if observation.created_by %} {{ observation.created_by|short_name }}{% with comp=observation.created_by|user_company %}{% if comp %} ({{ comp }}){% endif %}{% endwith %} {% else %} - {% endif %}

{% if observation.symptom %}
{% translate "Symptôme" %}
{{ observation.symptom.name_fr }}
{% endif %} {% if checklist_template and checklist_items_with_responses %}
{{ checklist_template.get_name }}
{% for item_data in checklist_items_with_responses %}
{{ item_data.item.get_name }}
{% if item_data.item.get_description %} {{ item_data.item.get_description }} {% endif %}
{% if item_data.response %} {% if item_data.item.item_type == 'boolean' %} {% if item_data.response.value_boolean %} {% translate "Oui" %} {% elif item_data.response.value_boolean == False %} {% translate "Non" %} {% else %} - {% endif %} {% elif item_data.item.item_type == 'text' %} {{ item_data.response.value_text|default:"-" }} {% elif item_data.item.item_type == 'number' %} {{ item_data.response.value_number|default:"-" }} {% elif item_data.item.item_type == 'choice' %} {% display_choice_value item_data.item item_data.response.value_choice %} {% elif item_data.item.item_type == 'choice_multiple' %} {% display_choice_value item_data.item item_data.response.value_choices %} {% endif %} {% if item_data.response.comment %}
{{ item_data.response.comment }}
{% endif %} {% else %} - {% endif %}
{% endfor %}
{% endif %} {% if observation.intervention %}
{% translate "Intervention liée" %}
{{ observation.intervention.get_status_display }} {% if can_view_intervention_summary_modal %} {% endif %} {% if can_view_intervention_detail %} {{ observation.intervention.code|default:observation.intervention.id }} {% else %} {{ observation.intervention.code|default:observation.intervention.id }} {% endif %}
{% endif %} {% if photos %}
{% translate "Photos" %} ({{ photos|length }})
{% for photo in photos %} {% private_file_url photo 'photo' as photo_url %} {% private_file_url photo 'thumbnail' as thumb_url %} Photo {% endfor %}
{% endif %}
{% translate "Commentaires" %}
{% if comments %}
{% for c in comments %}
{{ c.author|short_name }}{% with comp=c.author|user_company %}{% if comp %} ({{ comp }}){% endif %}{% endwith %}
{{ c.created_at|date:"d/m/Y H:i" }}
{{ c.comment|linebreaksbr }}
{% endfor %}
{% else %}

{% translate "Aucun commentaire." %}

{% endif %}
{% translate "Messages" %}
{% if discussion_messages %}
{% for msg in discussion_messages %}
{% if msg.author != request.user %}
{{ msg.author|short_name|first|upper|default:msg.author.username|first|upper }}
{% endif %}
{% if msg.author != request.user %}
{{ msg.author|short_name }}{% with comp=msg.author|user_company %}{% if comp %} ({{ comp }}){% endif %}{% endwith %} · {{ msg.created_at|date:"d/m/Y H:i" }}
{% else %}
{{ msg.created_at|date:"d/m/Y H:i" }}
{% endif %}
{{ msg.content|render_mentions }} {% if msg.attachments.exists %}
{% for att in msg.attachments.all %} {% if att.is_image %} {{ att.name }} {% else %} {{ att.name|truncatechars:20 }} {% endif %} {% endfor %}
{% endif %}
{% endfor %}
{% else %}

{% translate "Aucun message." %}

{% endif %} {% if can_post_discussion_message %}
{% csrf_token %}
{% endif %}
{% if geom_geojson %}
{% translate "Carte" %}
{% endif %} {% if observation.intervention and can_view_intervention_summary_modal %} {% endif %} {% if can_delete %} {% endif %} {% if can_link %} {% endif %} {% endblock content %} {% block extra_scripts %} {{ detail_symptoms_autocomplete|json_script:"detail-symptoms-list" }} {% if geom_geojson %} {% endif %} {% endblock extra_scripts %}