{# CODEX_DJANGO_CLI BLUEPRINT STATUS: MOVE_TO_CLI_BLUEPRINT. Reason: generated app-layer or scaffold-owned template for codex-django-cli blueprints. #} {% extends "cabinet/base_cabinet.html" %} {% load i18n cabinet_tags %} {% block title %}{{ message.subject|default:message.sender_name }}{% endblock %} {% block cabinet_content %}
{% if message %} {# ── Header ── #} {% url 'cabinet:conversations_inbox' as inbox_url %} {% include "cabinet/includes/_page_header.html" with title=message.subject|default:"—" btn_label="Назад" btn_url=inbox_url btn_icon="bi-arrow-left" %} {# ── Message card ── #}
{# Meta #}
{{ message.sender_name }} <{{ message.sender_email }}> {% if message.sender_phone %}{{ message.sender_phone }}{% endif %} {{ message.created_at|date:"d M Y, H:i" }}
{% include "cabinet/includes/_status_badge.html" with label=message.get_topic_display bg="#f1f5f9" color="var(--cab-text-muted)" %} {% include "cabinet/includes/_status_badge.html" with label=message.get_source_display bg="#f1f5f9" color="var(--cab-text-muted)" %} {% if message.status == 'open' %} {% include "cabinet/includes/_status_badge.html" with label=message.get_status_display bg="#ede9fe" color="#6366f1" %} {% elif message.status == 'processed' %} {% include "cabinet/includes/_status_badge.html" with label=message.get_status_display bg="#dcfce7" color="#16a34a" %} {% else %} {% include "cabinet/includes/_status_badge.html" with label=message.get_status_display bg="#fee2e2" color="#dc2626" %} {% endif %} {% if message.is_read %} {% trans "Read" as read_label %} {% include "cabinet/includes/_status_badge.html" with label=read_label bg="#ecfeff" color="#0f766e" %} {% else %} {% trans "Unread" as unread_label %} {% include "cabinet/includes/_status_badge.html" with label=unread_label bg="#fff7ed" color="#c2410c" %} {% endif %}
{% for action in thread_actions %}
{% csrf_token %}
{% endfor %}
{# Body #}
{{ message.body }}
{# Replies #} {% if replies %}
{% trans "История переписки" %}
{% for reply in replies %}
{% if reply.is_inbound %}{{ message.sender_name }}{% else %}{{ reply.sent_by }}{% endif %} · {{ reply.sent_at|date:"d M, H:i" }}
{{ reply.body }}
{% endfor %}
{% endif %} {# Reply form (Consistent with Compose) #}
{% else %} {% include "cabinet/includes/_empty_state.html" with icon="bi-exclamation-circle" title="Сообщение не найдено" %} {% endif %}
{% endblock %}