{% extends "@FerienpassAdmin/layout/base.html.twig" %}
{% trans_default_domain 'admin' %}


{% block main %}

    <twig:Admin:PageHeader title="Versand nachverfolgen" subtitle="Sie können dem Versand der E-Mails nun zuschauen. Die Seite aktualisiert sich automatisch." />

    <div class="mt-6 mb-8">
        <p class="text-sm text-gray-500 dark:text-gray-400">
            erstellt von
            {% if log.users is not empty %}
                {% for user in log.users %}
                    <a href="{{ path('admin_accounts_show', { uuid: user.uuid.toBase58 }) }}" class="font-medium text-gray-900 dark:text-gray-100" data-turbo-frame="_top">
                        {{ user.name }}
                    </a>
                    {% if not loop.last %}, {% endif %}
                {% endfor %}
            {% else %}
                <span class="font-medium text-gray-900 dark:text-gray-100">Unbekannt</span>
            {% endif %}
        </p>
        <p class="mt-1 text-sm text-gray-500 dark:text-gray-400">
            <span>
                <time datetime="{{ log.createdAt|date('c') }}" title="{{ log.createdAt|date('d.m.Y, H:i') }}">{{ log.createdAt|time_diff }}</time>
            </span>
            {% if log.offers is not empty %}
                <span class="mx-1">·</span>
                <span>{{ log.offers|map(o => o.name)|join(', ') }}</span>
            {% endif %}
        </p>
    </div>

    <twig:Admin:SentMessages log="{{ log }}"/>

{% endblock %}
