{% extends "@FerienpassAdmin/layout/modalBase.html.twig" %}

{% block main %}

    {% if item.stash %}
        <p>Diese Anmeldung ist derzeit unbestätigt (in einem Stash). Sie muss erst festgeschrieben werden.</p>
    {% elseif item.payable and not item.paid %}

        {% include '@FerienpassAdmin/fragment/deleteModal.html.twig' with {
            metadata: {
                participant: '{{ item.participant.name }}',
                offer: '{{ item.offer.name }}',
                date: '
    {% if item.offer.dates is not empty %}
        {% set startDate = item.offer.dates|first.begin %}
        {% if startDate %}
            <time datetime="{{ startDate|date(\'c\') }}">{{ startDate|format_datetime(pattern="E, dd.MM.yyyy HH:mm") }}</time>
        {% else %}
            <span class="inline-flex items-center text-orange-600">
                {{ ux_icon('ph:warning', {class: 'mr-1 size-4'}) }}
                <span>Termin fehlt</span>
            </span>
        {% endif %}
    {% else %}
        <span>Dauerangebot</span>
    {% endif %}
    ',
                fee: '{{ (item.offer.getFeePayable(item.participant, dispatcher)/100)|format_currency("EUR", locale="de") }}'
            },
            modalHeadline: 'attendance.waivePaymentModal.headline',
            modalConfirm: 'attendance.waivePaymentModal.confirm',
            modalSubmit: 'attendance.waivePaymentModal.submit'
        } %}

    {% elseif not item.payable %}

        {% include '@FerienpassAdmin/fragment/deleteModal.html.twig' with {
            metadata: {
                participant: '{{ item.participant.name }}',
                offer: '{{ item.offer.name }}',
                date: '
    {% if item.offer.dates is not empty %}
        {% set startDate = item.offer.dates|first.begin %}
        {% if startDate %}
            <time datetime="{{ startDate|date(\'c\') }}">{{ startDate|format_datetime(pattern="E, dd.MM.yyyy HH:mm") }}</time>
        {% else %}
            <span class="inline-flex items-center text-orange-600">
                {{ ux_icon('ph:warning', {class: 'mr-1 size-4'}) }}
                <span>Termin fehlt</span>
            </span>
        {% endif %}
    {% else %}
        <span>Dauerangebot</span>
    {% endif %}
    ',
                fee: '{{ (item.offer.getFeePayable(item.participant, dispatcher)/100)|format_currency("EUR", locale="de") }}'
            },
            modalHeadline: 'attendance.requirePaymentModal.headline',
            modalConfirm: 'attendance.requirePaymentModal.confirm',
            modalSubmit: 'attendance.requirePaymentModal.submit'
        } %}

    {% endif %}

{% endblock %}
