<?xml version="1.0"?>
<t name="Registration" t-name="website_event.registration_template">
    <a t-if="event_page and event.event_registrations_open" type="button" t-attf-class="btn btn-primary {{cta_additional_classes}}" t-att-href="'/event/%s/register' % (slug(event))">
        Register
    </a>
    <button t-elif="event.event_registrations_open" type="button" data-bs-toggle="modal" t-attf-class="btn btn-primary {{cta_additional_classes}}" t-attf-data-bs-target="#modal_{{'slot' if event.is_multi_slots else 'ticket'}}_registration">
        Register
    </button>
    <div t-if="registration_error_code == 'insufficient_seats'" class="alert alert-danger my-3" role="alert">
        Registration failed! These tickets are not available anymore.
    </div>
    <div t-if="registration_error_code == 'recaptcha_failed'" class="alert alert-danger my-3" role="alert">
        Registration failed! Suspicious activity detected by Google reCaptcha.
    </div>
    <t t-if="not event.event_registrations_open">
        <!-- Delayed registration time -->
        <div t-if="not event.event_registrations_started and not event.event_registrations_sold_out" class="alert alert-info mb-3 small" role="status">
            Registrations will open on
            <b t-out="event.start_sale_datetime" t-options="{'widget': 'datetime', 'tz_name': event.date_tz, 'format': 'MMMM dd, y'}"/>, at
            <b t-out="event.start_sale_datetime" t-options="{'widget': 'datetime', 'tz_name': event.date_tz, 'format': 'h:mm a'}"/>
            <small t-if="website_visitor_timezone != event.date_tz">(<t t-out="event.date_tz"/> time)</small>
        </div>
        <!-- Sold Out -->
        <div t-elif="event.event_registrations_sold_out" class="alert alert-danger mb-3 small" role="status">
            <b>Sold Out</b>
        </div>
        <!-- Registrations Closed -->
        <div t-else="" class="alert alert-warning mb-3 small" role="status">
            <em>Registrations <b>Closed</b></em>
        </div>
    </t>
</t>

