{# Compact inbox-style thread list for the ticket-header "N threads" popup. Rendered by GET /customer//threads-mini. See customer_threads_mini(). #} {% macro status_chip(status) -%} {% set map = { 'open': (_('Open'), 'bg-blue-100 dark:bg-blue-500/15 text-blue-700 dark:text-blue-300'), 'in_progress': (_('In Progress'), 'bg-amber-100 dark:bg-amber-500/15 text-amber-700 dark:text-amber-300'), 'waiting_customer': (_('Waiting'), 'bg-purple-100 dark:bg-purple-500/15 text-purple-700 dark:text-purple-300'), 'answered': (_('Answered'), 'bg-emerald-100 dark:bg-emerald-500/15 text-emerald-700 dark:text-emerald-300'), 'closed': (_('Closed'), 'bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400'), } %} {% set label, cls = map.get(status, (status or '—', 'bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400')) %} {{ label }} {%- endmacro %} {% macro thread_row(it) -%} {% set is_link = it.ticket_id and not it.is_current %} <{% if is_link %}a href="/ticket/{{ it.ticket_id }}"{% else %}div{% endif %} class="flex items-center gap-2.5 px-3 py-2.5 rounded-lg transition-colors {% if it.is_current %}bg-brand-50 dark:bg-brand-500/10 ring-1 ring-brand-200 dark:ring-brand-500/30 cursor-default {% else %}hover:bg-gray-50 dark:hover:bg-gray-700/50{% endif %}"> {# Product icon / BC badge #}
{% if it.product_type == 'business_care' %}
{{ _("BC") }}
{% elif it.pico_url %} {% else %}
extension
{% endif %}
{# Subject + meta #}
{% if not it.is_read %}{% endif %} {{ it.subject }} {% if it.is_current %}{{ _("current") }}{% endif %}
{% if it.provider_thread_id %}#{{ it.provider_thread_id }}{% endif %} {% if it.last_activity_at %}{{ it.last_activity_at|localdt('%Y-%m-%d') }}{% endif %}
{# Status #} {{ status_chip(it.status) }} {%- endmacro %} {% if total == 0 %}

{{ _("No other threads from this customer.") }}

{% elif group_by_module %}
{% for module_name, rows in grouped.items() %}

{{ module_name }} · {{ rows|length }}

{% for it in rows %}{{ thread_row(it) }}{% endfor %}
{% endfor %}
{% else %}
{% for it in items %}{{ thread_row(it) }}{% endfor %}
{% endif %}