{% extends "base.html" %} {% block title %}{{ _("Inbox") }}{% endblock %} {% block content %} {# ── Mobile card styles (below md = 768px) ── #} {# Scoped to #inbox-page so no other table is affected. #} {# Strategy: CSS-only responsive cards — / structure is untouched so #} {# the AJAX tbody swap (refreshInboxRows) keeps working with zero JS changes. #} {# The
{# ── Header row ── #}

{{ _("Inbox") }} — {% if filters.presale %}{{ _("Pre Sale Messages") }}{% elif filters.status == 'open' %}{{ _("Open") }}{% elif filters.status == 'in_progress' %}{{ _("In Progress") }}{% elif filters.status == 'waiting_customer' %}{{ _("Waiting") }}{% elif filters.status == 'answered' %}{{ _("Answered") }}{% elif filters.status == 'closed' %}{{ _("Closed") }}{% else %}{{ _("All Tickets") }}{% endif %}

{% if last_msg_sync %} {{ _("last synced") }} {{ _("(sync now)") }} {% endif %}
{% trans count=total_count %}{{ count }} ticket{% pluralize %}{{ count }} tickets{% endtrans %}
{# ── Filters ── #}
{% if filters.status or filters.priority or filters.tag or filters.search or filters.product %} {{ _("Clear") }} {% endif %}
{# ── Ticket table ── #}
{% for ticket in tickets %} {# Star toggle #} {# ID + external link #} {# Product (icon only, tooltip shows name) #} {# Subject + snippet #} {# Last message preview #} {# PS Version #} {# Status badge #} {# Priority badge #} {# Support status #} {# Last activity #} {% else %} {% endfor %}
{{ _("Star") }} {{ _("Subject") }} {{ _("Status") }}
{# 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_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 %}
{% 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' %} {{ _("Waiting") }} {% elif ticket.status == 'answered' %} check_circle{{ _("Answered") }} {% elif ticket.status == 'closed' %} {{ _("Closed") }} {% else %} {{ ticket.status }} {% endif %}
{% if not has_api_key and not is_filtered %} key

{{ _("Connect your PrestaShop Addons account") }}

{{ _("Import your support threads by linking your Addons API key.") }}

{{ _("Set up Addons integration →") }} {% else %} {{ empty_state.icon }}

{{ empty_state.title }}

{{ empty_state.hint }}

{% endif %}
{# ── Pagination ── #} {% if total_pages > 1 %}

{% trans %}Page {{ page }} of {{ total_pages }}{% endtrans %}

{% if page > 1 %} chevron_left {% endif %} {% for p in range(1, total_pages + 1) %} {% if p == page %} {{ p }} {% elif p == 1 or p == total_pages or (p >= page - 2 and p <= page + 2) %} {{ p }} {% elif p == 2 and page > 4 %} {% elif p == total_pages - 1 and page < total_pages - 3 %} {% endif %} {% endfor %} {% if page < total_pages %} chevron_right {% endif %}
{% endif %}
{% endblock %}