{% from 'confirmation_dialog.html' import confirmation_dialog %}

{% set ok_text=_("Delete events") %}

{% set confirmation_message %}
    {% if num_booking_occurrences %}
        {% trans strong='<strong>'|safe, endstrong='</strong>'|safe -%}
            Please note that if you delete the events you will lose all the information contained in them,
            {{ strong }}including {{ num_booking_occurrences }} Room Booking occurrence(s){{ endstrong }}.
            This operation is irreversible!
        {%- endtrans %}
    {% else %}
        {% trans -%}
            Please note that if you delete the events you will lose all the information contained in them.
            This operation is irreversible!
        {%- endtrans %}
    {% endif %}
{% endset %}

{% if events %}
    {% call confirmation_dialog('danger', message=confirmation_message, ok_text=ok_text) %}
        {% trans count=events|length -%}
            You are about to <strong>delete</strong> the following event:
        {%- pluralize -%}
            You are about to <strong>delete</strong> the following <strong>{{ count }}</strong> events:
        {%- endtrans %}
        <ul>
            {% for event in events %}
                <li>
                    <input type="hidden" name="event_id" value="{{ event.id }}">
                    <a href="{{ url_for('event_management.settings', event) }}" target="_blank">
                        {{ event.title }}
                    </a>
                    ({{ event.start_dt|format_date(timezone=event.timezone) }})
                </li>
            {% endfor %}
        </ul>
    {% endcall %}
{% endif %}
