{% extends 'base.html.twig' %} {% block title %}{{ ticket.reference }} - Support Admin{% endblock %} {% block body %}
{# Breadcrumb #}
{% include '_molecules/breadcrumb/breadcrumb.html.twig' with { homeHref: path('app_dashboard'), items: [ { label: 'Support', href: path('admin_support_index') }, { label: ticket.reference } ] } only %}
{# Header #} {% set statusVariant = ticket.status == 'open' ? 'warning' : (ticket.status == 'in_progress' ? 'info' : 'success') %}
{{ ticket.reference }} {% include '_atoms/badge/badge.html.twig' with { label: ticket.categoryLabel, variant: 'neutral', size: 'xs' } only %} {% include '_atoms/badge/badge.html.twig' with { label: ticket.statusLabel, variant: statusVariant, size: 'xs', dot: true } only %}

{{ ticket.subject }}

{{ ticket.user.fullName ?: ticket.user.email }} · {{ ticket.user.email }} · {{ ticket.createdAt|date('d/m/Y à H:i') }}

{% include '_atoms/button/button.html.twig' with { label: 'Retour', variant: 'ghost', icon: 'arrow-left', size: 'sm', href: path('admin_support_index') } only %} {% if not ticket.isResolved %}
{% include '_atoms/button/button.html.twig' with { label: 'Marquer résolu', variant: 'success', icon: 'check', size: 'sm', type: 'submit' } only %}
{% endif %}
{# Chat #}
{# Messages #}
{% for message in ticket.messages %} {% if message.isFromAdmin %} {# Côté admin (droite) #}

{{ message.author.fullName ?: message.author.email }} · Équipe Bubul

{{ message.content }}

{{ message.createdAt|date('H:i · d/m/Y') }}

{% else %} {# Côté utilisateur (gauche) #}

{{ ticket.user.fullName ?: ticket.user.email }}

{{ message.content }}

{{ message.createdAt|date('H:i · d/m/Y') }}

{% endif %} {% endfor %}
{# Réponse admin #}
{% include '_atoms/button/button.html.twig' with { label: 'Répondre', variant: 'primary', icon: 'send', type: 'submit', size: 'md' } only %}

Envoyé par {{ app.user.fullName ?: app.user.email }} · Équipe Bubul

{% endblock %}