{% extends "base.html" %} {% block title %}{{ mail.subject or '(sans sujet)' }} - {{ account.email }}{% endblock %} {% block content %}
{% if mail.folder_id %} Retour au dossier {% else %} Retour aux emails {% endif %}

{{ mail.subject or '(sans sujet)' }}

De: {{ mail.from_name or 'Inconnu' }} {% if mail.from_email %} <{{ mail.from_email }}> {% endif %}
{% if mail.to_recipients %}
À: {% set recipients = mail.to_recipients|from_json if mail.to_recipients is string else mail.to_recipients %} {{ recipients|join(', ') if recipients is iterable else mail.to_recipients }}
{% endif %} {% if mail.cc_recipients %}
Cc: {% set cc = mail.cc_recipients|from_json if mail.cc_recipients is string else mail.cc_recipients %} {{ cc|join(', ') if cc is iterable else mail.cc_recipients }}
{% endif %}
{{ mail.received_at.strftime('%d/%m/%Y %H:%M') if mail.received_at else '-' }}
{% if mail.importance == 'high' %} Priorité haute {% elif mail.importance == 'low' %} Priorité basse {% endif %}
{% if mail.body_type == 'html' or (mail.body_content and '<' in mail.body_content[:50]) %} {% else %} {% endif %}
{% if mail.has_attachments or attachments %} {% endif %}
Interprétation GMAO
Chargement du contexte... Modifier
{% if interpretations %} {% for interp in interpretations %}
{{ interp.created_at.strftime('%d/%m/%Y %H:%M') }}
{% if interp.user_context %}
Contexte: {{ interp.user_context }}
{% endif %} {% if interp.analysis_type %}
{% if interp.analysis_type == 'curative' %} Curative {% elif interp.analysis_type == 'preventive' %} Préventive {% elif interp.analysis_type == 'administrative' %} Administrative {% elif interp.analysis_type == 'formation' %} Formation {% else %} Information {% endif %} {% if interp.analysis_action == 'create' %} Nouvelle intervention {% elif interp.analysis_action == 'update' %} Mise à jour {% else %} Information {% endif %} {% if interp.confidence_score %} Confiance: {{ '%.0f'|format(interp.confidence_score * 100) }}% {% endif %} {% if interp.suggested_title %}
{{ interp.suggested_title }}
{% endif %}
{% if interp.suggested_location %}
Lieu: {{ interp.suggested_location }}
{% endif %} {% if interp.suggested_equipment %}
Équipement: {{ interp.suggested_equipment }}
{% endif %} {% if interp.suggested_urgency %}
{% if interp.suggested_urgency == 'urgente' %} Urgence: Urgente {% elif interp.suggested_urgency == 'haute' %} Urgence: Haute {% elif interp.suggested_urgency == 'normale' %} Urgence: Normale {% else %} Urgence: Basse {% endif %}
{% endif %} {% if interp.suggested_assignee %}
Intervenant: {{ interp.suggested_assignee }}
{% endif %} {% if interp.suggested_date %}
Date suggérée: {{ interp.suggested_date.strftime('%d/%m/%Y') }}
{% endif %}
{% if interp.suggested_description %}
Description: {{ interp.suggested_description[:200] }}{% if interp.suggested_description|length > 200 %}...{% endif %}
{% endif %} {% if interp.analysis_action == 'create' and interp.analysis_type == 'administrative' %}
{% elif interp.analysis_action == 'create' %}
{% elif interp.analysis_action == 'update' %}
{% else %} {# Type information - pas d'action mais afficher le JSON #}
{% endif %} {# Afficher la description si présente #} {% if interp.suggested_description and interp.suggested_description != 'null' %}
{{ interp.suggested_description[:300] }}{% if interp.suggested_description|length > 300 %}...{% endif %}
{% endif %}
{% else %}
{{ interp.interpretation|replace('\n', '
')|safe }}
{% endif %}
{% endfor %} {% else %}

Aucune interprétation

{% endif %}
{% endblock %}