{% extends "layouts/base.twig" %} {% block title %}{{ translations.demands_title | default('Demandes') }}{% endblock %} {% block head %} {{ parent() }} {% endblock %} {% block page_heading %}

{{ translations.demands_title | default('Demandes') }}

{{ translations.demands_subtitle | default('Przegląd wszystkich zgłoszeń sieci franczyzowej.') }}

{% endblock %} {% block content %} {# ── KPI cards ──────────────────────────────────────────────────── #}
{{ stats.total | default('—') }}
{{ translations.kpi_total | default('Łącznie') }}
{{ stats.by_status.NEW | default('—') }}
{{ translations.status_new | default('Nowe') }}
{{ stats.by_status.IN_PROGRESS | default('—') }}
{{ translations.status_in_progress | default('W toku') }}
{{ stats.by_status.PUBLISHED | default('—') }}
{{ translations.status_published | default('Opublikowane') }}
{# ── Filters ────────────────────────────────────────────────────── #}
{# Status filter #} {{ translations.filter_status | default('Status') }}: {% for s in statuses %} {% endfor %} {# Shop filter #} {{ translations.filter_shop | default('Sklep') }}: {# Search #}
{# ── Table ──────────────────────────────────────────────────────── #}
{% if demands is not empty %} {% for d in demands %} {% endfor %} {% else %} {% endif %}
{{ translations.col_ref | default('Ref.') }} {{ translations.col_date | default('Data') }} {{ translations.col_requester | default('Wnioskodawca') }} {{ translations.col_shop | default('Sklep') }} {{ translations.col_subject | default('Temat') }} {{ translations.col_type | default('Typ') }} {{ translations.col_status | default('Status') }} {{ translations.col_priority | default('Priorytet') }}
{{ d.getRef() }} {{ d.getCreatedAt() | date('d/m/Y') }} {{ d.getRequesterName() ?? '—' }} {{ d.getShopName() ?? ('ID: ' ~ d.getShopId()) }} {{ d.getDisplaySubject() | length > 40 ? d.getDisplaySubject() | slice(0, 40) ~ '…' : d.getDisplaySubject() }} {{ translations['type_' ~ d.getType() | lower] | default(d.getTypeLabel()) }} {% include 'demands/partials/_status_badge.twig' with {status: d.getStatus()} %} {% if d.getPriority() %} {{ d.getPriority() | lower | capitalize }} {% endif %}
{{ translations.no_demands | default('Brak zgłoszeń.') }}
{% endblock %} {% block scripts %} {% endblock %}