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

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

{% call confirmation_dialog('danger', message=confirmation_message, ok_text=_('Delete event')) %}
    {% trans event_title=event.title, event_date=event.start_dt|format_date(timezone=event.tzinfo) -%}
        You are about to <strong>delete</strong> the whole event <strong>{{ event_title }} ({{ event_date }})</strong>
    {%- endtrans %}
{% endcall %}
