{% trans_default_domain 'email' %}

<table align="center"
       class="attributes_content w-full p-24 bg-gray-postmark-lightest">
    <tr>
        <td align="center">
            <h2 class="mt-0 mb-2 text-xl text-center font-bold text-gray-postmark-darker">{{ offer.name|machine_translate }}</h2>
            <p class="mt-0 text-xs text-center text-gray-postmark-dark">
                {{ 'organizer'|trans }}: {{ offer.hosts|map(h => h.name|machine_translate)|join(', ') }}</p>
            <div class="mt-6 mb-20">
                {% if offer.dates is not empty %}
                    <p class="mt-0 mb-0 text-base leading-24 text-center text-gray-postmark-dark">
                        <span class="font-bold">{{ 'start'|trans }}:</span> <twig:Cms:OfferDateSingle :date="offer.dates|first" :noTime="false" locale="de" />
                    </p>
                {% endif %}

                {% if not offer.cancelled and (attendance is not defined or not attendance.rejected) %}
                    <p class="mt-0 mb-0 text-base leading-24 text-center text-gray-postmark-dark">
                        <span class="font-bold">{{ 'meetingPoint'|trans }}:</span>
                        {{ offer.meetingPoint|machine_translate }}</p>
                    {% if offer.bring %}
                        <p class="mt-0 mb-0 text-base leading-24 text-center text-gray-postmark-dark">
                            <span class="font-bold">{{ 'pleaseBring'|trans }}:</span>
                            {{ offer.bring|machine_translate }}</p>
                    {% endif %}
                    {% if attendance is not defined or not attendance.paid %}
                        <p class="mt-0 mb-0 text-base leading-24 text-center text-gray-postmark-dark">
                            <span class="font-bold">{{ 'participationFee'|trans }}:</span> {{ (offer.fee/100)|format_currency('EUR', locale='de') }}
                        </p>
                    {% endif %}
                {% endif %}
            </div>

            {% if showDescription|default %}
                <p class="mt-6 text-xs text-gray-postmark-dark">
                    {{ offer.description|machine_translate|markdown_to_html }}
                </p>
            {% endif %}

            {% if attendance is defined and attendance.payable and not attendance.paid and integrations_manager.isIntegrationConfigured('PmPaymentProvider') %}
                <p class="mt-1">
                    <span class="mt-2 rounded bg-blue-100 border-l-8 border-r-8 border-t-4 border-b-4 border-solid border-blue-100">
                        <span class="text-sm mt-0 mb-0 leading-5 text-blue-700">
                            {{ 'payFeeOnline'|trans }}
                        </span>
                    </span>
                </p>
                <p class="text-xs text-gray-postmark-dark">{{ 'furtherInfoInProfile'|trans }}</p>
            {% endif %}

            {% if offer.requiresAgreementLetter and not offer.cancelled and (attendance is not defined or not attendance.rejected) %}
                <p class="mb-2">
                    <span class="mt-2 rounded bg-yellow-100 border-l-8 border-r-8 border-t-4 border-b-4 border-solid border-yellow-100">
                        <span class="text-sm mt-0 mb-0 leading-5 text-yellow-700">{{ 'pleaseProvideAgreementLetter'|trans }}</span>
                    </span>
                </p>
                <p class="mt-0 mb-20 leading-24 text-center text-gray-postmark-dark text-xs">
                    {{ 'downloadAt'|trans }}:
                    <a href="{{ absolute_url(path('cms', { to: 'offer_list', edition: offer.edition, auto_item: offer.alias })) }}"
                       class="text-gray-postmark-dark underline">{{ absolute_url(path('cms', { to: 'offer_list', edition: offer.edition, auto_item: offer.alias })) }}</a>
                </p>
            {% endif %}

            {% if not offer.cancelled and showStatus|default %}
                <p>
                    <span class="mt-2 rounded bg-green-100 border-l-8 border-r-8 border-t-4 border-b-4 border-solid border-green-100">
                        <span class="text-sm mt-0 mb-0 leading-5 text-green-700">{{ 'offerTakesPlace'|trans }}</span>
                    </span>
                </p>
            {% endif %}

            {% if offer.cancelled or (attendance is defined and attendance.rejected) %}
                <p>
                    <span class="mt-2 rounded bg-red-100 border-l-8 border-r-8 border-t-4 border-b-4 border-solid border-red-100">
                        <span class="text-sm mt-0 mb-0 leading-5 text-red-700">{{ 'offerCancelledNotice'|trans }}</span>
                    </span>
                </p>
            {% endif %}

        </td>
    </tr>
</table>
