{% for ticket in tickets %} {# Star toggle #} {# ID + external link #}
#{{ ticket.provider_thread_id or ticket.id }} {% if ticket.provider_thread_id %} open_in_new {% endif %} {% if not ticket.is_read %} {% endif %} {% if ticket.has_ai %} psychology {% endif %} {% if ticket.customer_revenue and ticket.customer_revenue|float > 500 %} {{ _("VIP") }} {% elif ticket.customer_revenue and ticket.customer_revenue|float > 100 %} military_tech {% endif %} {% if ticket.is_review_request %} sentiment_very_satisfied{{ _("Thanks") }} {% endif %} {% if ticket.is_new %} {{ _("New") }} {% endif %} {% if ticket.is_presale %} {{ _("Pre-sale") }} {% endif %} {% if ticket.is_autoresponded %} {{ _("Auto-replied") }} {% endif %}
{# Product (icon only, tooltip shows name) #} {% if ticket.product_type == 'business_care' %} {% if ticket.id_product %}
BC
{% else %}
BC
{% endif %} {% elif ticket.pico_url %} {% if ticket.id_product %} {{ ticket.product_name or '' }} {% else %} {{ ticket.product_name or '' }} {% endif %} {% else %} - {% endif %} {# Subject + snippet #} {# Mobile-only: ID + badges inline above subject #}
#{{ ticket.provider_thread_id or ticket.id }} {% if not ticket.is_read %}{% endif %} {% if ticket.has_ai %}psychology{% endif %} {% if ticket.customer_revenue and ticket.customer_revenue|float > 500 %}{{ _("VIP") }}{% elif ticket.customer_revenue and ticket.customer_revenue|float > 100 %}military_tech{% endif %} {% if ticket.is_review_request %}{{ _("Thanks") }}{% endif %} {% if ticket.is_new %}{{ _("New") }}{% endif %} {% if ticket.is_presale %}{{ _("Pre-sale") }}{% endif %} {% if ticket.is_autoresponded %}{{ _("Auto-replied") }}{% endif %} {% if ticket.customer_website %}language{{ (ticket.customer_website | replace('https://', '') | replace('http://', '')).split('/')[0] }}{% endif %}
{{ ticket.subject }} {% if ticket.customer_website %} {% endif %}
{% if ticket.latest_topic_label %} {{ ticket.latest_topic_label }} {% endif %} {% if ticket.last_snippet %}

{{ ticket.last_snippet }}

{% endif %} {# Last message preview #} {% if ticket.last_msg_direction %}
{% if ticket.last_msg_direction == 'inbound' %} call_received {% else %} call_made {% endif %}
{% else %} - {% endif %} {# PS Version #} {{ ticket.ps_version or '-' }} {# Status badge #} {% if ticket.is_review_request and ticket.status == 'closed' %} favorite{{ _("Thanks") }} {% elif ticket.status == 'open' %} {{ _("Open") }} {% elif ticket.status == 'in_progress' %} {{ _("In Progress") }} {% elif ticket.status == 'waiting_customer' %} hourglass{{ _("Waiting") }} {% elif ticket.status == 'answered' %} check_circle{{ _("Answered") }} {% elif ticket.status == 'closed' %} {{ _("Closed") }} {% else %} {{ ticket.status }} {% endif %} {# Priority badge #} {% if ticket.priority == 'p1' %} {{ _("Critical") }} {% elif ticket.priority == 'p2' %} {{ _("High") }} {% elif ticket.priority == 'p3' %} {{ _("Normal") }} {% else %} {{ _("Low") }} {% endif %} {# Support status #} {% if ticket.is_support_expired %} error{{ _("Expired") }} {% else %} check_circle{{ _("Active") }} {% endif %} {# Last activity #} {{ ticket.last_activity_at|localdt('%Y-%m-%d %H:%M') if ticket.last_activity_at else '-' }} {% else %} {{ empty_state.icon if empty_state else 'inbox' }}

{{ empty_state.title if empty_state else _("No tickets found.") }}

{{ empty_state.hint if empty_state else _("Try adjusting your filters or sync new messages.") }}

{% endfor %}