{% extends 'layouts/base.twig' %} {% block title %}{{ translations.notification_history|default('Historia powiadomień') }}{% endblock %} {% block page_heading %}

{{ translations.notification_history|default('Historia powiadomień') }}

{{ translations.notification_history_subtitle|default('Powiadomienia które już odczytałeś') }}

{% endblock %} {% block content %}
{% if notifications is empty %}
{{ translations.no_read_notifications|default('Brak odczytanych powiadomień') }}

{{ translations.no_read_notifications_hint|default('Powiadomienia pojawią się tutaj po ich odczytaniu.') }}

{% else %}

{{ translations.notification_history|default('Historia powiadomień') }} {{ notifications|length }}

{% for notif in notifications %} {% set priorityClass = 'border-secondary' %} {% set priorityIconClass = 'text-secondary' %} {% set priorityIcon = 'bi-info-circle' %} {% if notif.getPriority() == 'warning' %} {% set priorityClass = 'border-warning' %} {% set priorityIconClass = 'text-warning' %} {% set priorityIcon = 'bi-exclamation-triangle' %} {% elseif notif.getPriority() == 'urgent' %} {% set priorityClass = 'border-danger' %} {% set priorityIconClass = 'text-danger' %} {% set priorityIcon = 'bi-exclamation-octagon' %} {% endif %} {# Ustal URL akcji - z modelu lub fallback z batch_id #} {% set actionUrl = notif.getActionUrl() %} {% if not actionUrl and notif.getBatchId() %} {% set actionUrl = root ~ '/price-change-batches/' ~ notif.getBatchId() %} {% endif %} {% set actionLabel = notif.getActionLabel()|default(translations.go_to|default('Przejdź')) %}
{{ notif.getTitle() }} {% if notif.getPriority() == 'urgent' %} {{ translations.urgent|default('Pilne') }} {% elseif notif.getPriority() == 'warning' %} {{ translations.warning|default('Ważne') }} {% endif %}
{% if notif.getLastReadAt() %} {{ notif.getLastReadAt()|slice(0,16) }} {% endif %} {% if notif.getReadCount() > 1 %} {{ notif.getReadCount() }}× {% endif %}

{{ notif.getMessage() }}

{# Szczegóły batcha zmian cen #} {% if notif.getBatchId() %}
{% if notif.getBatchSupplierId() %} {{ translations.supplier|default('Dostawca') }} #{{ notif.getBatchSupplierId() }} {% endif %} {% if notif.getBatchItemCount() %} {{ notif.getBatchItemCount() }} {{ translations.products|default('produktów') }} {% endif %} {% if notif.getBatchStatus() == 'read' and notif.getBatchReadAt() %} {{ translations.confirmed_at|default('Zatwierdzone') }}: {{ notif.getBatchReadAt()|slice(0,16) }} {% elseif notif.getBatchStatus() == 'locked' %} {{ translations.status_locked|default('Przeglądane') }} {% endif %}
{% endif %} {% if actionUrl %} {{ actionLabel }} {% endif %}
{% endfor %}
{% if notifications|length >= limit %} {% endif %}
{% endif %}
{% endblock %} {% block scripts %} {% endblock %}