<?xml version="1.0"?>
<t name="Event Description" track="1" t-name="website_event.event_description_full">
    <t t-set="hide_submenu" t-value="True"/>
    <t t-set="hide_register_cta" t-value="True"/>
    <t t-set="opt_event_description_cover_hidden" t-value="is_view_active('website_event.opt_event_description_cover_hidden')"/>
    <t t-set="opt_event_description_cover_top" t-value="is_view_active('website_event.opt_event_description_cover_top')"/>
    <t t-set="opt_event_fixed_sidebar" t-value="is_view_active('website_event.opt_event_fixed_sidebar')"/>
    <t t-set="opt_event_registration_block" t-value="is_view_active('website_event.opt_event_registration_block')"/>
    <t t-set="opt_event_dates_block" t-value="is_view_active('website_event.opt_event_dates_block')"/>
    <t t-set="opt_event_calendar_block" t-value="is_view_active('website_event.opt_event_calendar_block')"/>
    <t t-set="opt_event_location_block" t-value="is_view_active('website_event.opt_event_location_block')"/>
    <t t-set="opt_event_organizer_block" t-value="is_view_active('website_event.opt_event_organizer_block')"/>
    <t t-set="opt_event_share_block" t-value="is_view_active('website_event.opt_event_share_block')"/>
    <t t-set="edition_cover_only" t-value="opt_event_description_cover_hidden and request.env.user.has_group('event.group_event_manager')"/>

    <t t-call="website_event.event_details">
        <div t-if="toast_message" class="o_wevent_register_toaster d-none" t-att-data-message="toast_message"/>

        <t t-if="opt_event_description_cover_top" t-call="website.record_cover">
            <t t-set="_record" t-value="event"/>
            <t t-set="use_filters" t-value="True"/>
            <t t-set="use_size" t-value="True"/>
            <t t-set="use_text_align" t-value="True"/>
            <t t-set="additionnal_classes" t-value="'o_wevent_event_main_cover o_wevent_event_main_cover_top overflow-hidden h-auto'"/>

            <div class="container d-flex flex-grow-1 h-100 w-100">
                <div id="o_wevent_event_main_cover_content" class="d-flex flex-column align-items-baseline w-100 py-3">
                    <span t-if="event.is_participating" class="badge text-bg-success o_wevent_badge">
                        <i class="fa fa-check me-2" role="img"/>Registered
                    </span>
                    <div class="w-100 mt-auto">
                        <h2 t-field="event.name" itemprop="name" placeholder="Event Title" class="mt-3"/>
                        <p class="lead" t-field="event.subtitle" placeholder="Event Subtitle"/>
                    </div>
                </div>
            </div>
        </t>

        <section id="o_wevent_event_main" class="h-100" t-cache="event if not editable and event.website_published else None">
            <div t-attf-class="container pb-5 {{'' if opt_event_fixed_sidebar else 'overflow-hidden'}}">
                <div class="row">
                    <div class="col pe-xxl-5">
                        <t t-call="website_event.navbar"/>
                        <!-- Show the button tickets only on mobile -->
                        <div t-if="opt_event_registration_block" class="o_wevent_event_main_cta_block d-lg-none mb-3">
                            <t t-call="website_event.registration_template">
                                <t t-set="cta_additional_classes">w-100 py-sm-3 mt-sm-2</t>
                            </t>
                        </div>
                        <!-- Description -->
                        <div id="o_wevent_event_main_col">
                            <div t-if="edition_cover_only" class="css_non_editable_mode_hidden o_not_editable bg-info-light border border-info border-bottom-0 rounded-top p-2">
                                <em>Hidden for visitors</em>
                            </div>
                            <t t-if="not opt_event_description_cover_top" t-call="website.record_cover">
                                <t t-set="_record" t-value="event"/>
                                <t t-set="use_filters" t-value="True"/>
                                <t t-set="use_size" t-value="False"/>
                                <t t-set="use_text_align" t-value="True"/>
                                <t t-set="additionnal_classes" t-value="'o_wevent_event_main_cover overflow-hidden ' + ('css_non_editable_mode_hidden border border-info rounded-bottom' if edition_cover_only else 'd-none' if opt_event_description_cover_hidden else 'rounded')"/>

                                <div id="o_wevent_event_main_cover_content" class="p-3 mt-auto">
                                    <span t-if="event.is_participating" class="badge text-bg-success o_wevent_badge">
                                        <i class="fa fa-check me-2" role="img"/>Registered
                                    </span>
                                    <h2 t-field="event.name" itemprop="name" placeholder="Event Title" class="mt-3"/>
                                    <p class="lead" t-field="event.subtitle" placeholder="Event Subtitle"/>
                                </div>
                            </t>
                            <div class="o_wevent_event_main_dates_mobile d-lg-none mt-3">
                                <t t-call="website_event.event_description_dates"/>
                            </div>
                            <div class="mt-4" t-field="event.description" itemprop="description"/>
                        </div>
                    </div>

                    <!-- Sidebar -->
                    <aside t-if="opt_event_registration_block or opt_event_dates_block or opt_event_calendar_block or                         opt_event_location_block or opt_event_organizer_block or opt_event_share_block" id="o_wevent_event_main_sidebar" t-attf-class="col-lg-4 py-3 pb-lg-0 d-print-none {{'sticky-top align-self-start' if opt_event_fixed_sidebar else ''}}">
                        <!-- CTA (desktop only) -->
                        <div t-if="opt_event_registration_block" class="d-none d-lg-block mb-3">
                            <t t-call="website_event.registration_template">
                                <t t-set="cta_additional_classes">w-100</t>
                            </t>
                        </div>
                        <!-- Date & Time (desktop only) -->
                        <div t-if="opt_event_dates_block or opt_event_calendar_block" class="o_wevent_bordered_block pb-3 mb-4 d-none d-lg-block">
                            <meta itemprop="startDate" t-att-content="event.date_begin.isoformat()"/>
                            <meta itemprop="endDate" t-att-content="event.date_end.isoformat()"/>
                            <t t-call="website_event.event_description_dates"/>
                        </div>
                        <header t-if="opt_event_location_block or opt_event_organizer_block or opt_event_share_block" class="d-lg-none mt-4 mb-2 py-3 border-top">
                            <h5 class="my-0">Event Info</h5>
                            <meta itemprop="eventStatus" content="https://schema.org/EventScheduled"/>
                        </header>
                        <!-- Location -->
                        <meta itemprop="eventAttendanceMode" t-attf-content="https://schema.org/{{'Offline' if event.address_id else 'Online'}}EventAttendanceMode"/>
                        <div t-if="opt_event_location_block and event.address_id" class="o_wevent_sidebar_block o_wevent_bordered_block pb-3 mb-4" itemprop="location" itemscope="itemscope" itemtype="https://schema.org/Place">
                            <div>
                                <h6 class="o_wevent_sidebar_title">Location</h6>
                            </div>
                            <div itemprop="name" class="mb-1" t-field="event.address_id"/>
                            <small class="d-block mb-2" t-field="event.address_id" t-options="{                                 &quot;widget&quot;: &quot;contact&quot;,                                 &quot;fields&quot;: [&quot;address&quot;],                                 &quot;no_marker&quot;: True,                                 &quot;with_microdata&quot;: True,                             }"/>
                            <small t-field="event.address_id" class="d-block mb-2" t-options="{                                 &quot;widget&quot;: &quot;contact&quot;,                                 &quot;fields&quot;: [&quot;phone&quot;, &quot;mobile&quot;, &quot;email&quot;]                             }"/>
                            <a t-att-href="event._google_map_link()" target="_blank" class="btn btn-light" title="Get directions">
                                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="align-text-top" role="img" style="height: 1em; width: 1em">
                                    <rect width="24" height="24" opacity="0"/>
                                    <path role="presentation" fill="currentColor" d="M13.67 22h-.06a1 1 0 0 1-.92-.8l-1.54-7.57a1 1 0 0 0-.78-.78L2.8 11.31a1 1 0 0 1-.12-1.93l16-5.33A1 1 0 0 1 20 5.32l-5.33 16a1 1 0 0 1-1 .68z"/>
                                </svg>
                                Get directions
                            </a>
                        </div>
                        <div t-elif="opt_event_location_block" class="o_wevent_sidebar_block o_wevent_bordered_block pb-3 mb-4">
                            <h6 class="o_wevent_sidebar_title">Location</h6>
                            <i class="fa fa-map-marker" title="Location"/> Online event
                        </div>
                        <!-- Organizer -->
                        <div t-if="opt_event_organizer_block and event.organizer_id" class="o_wevent_sidebar_block o_wevent_bordered_block pb-3 mb-4" itemprop="organizer" itemscope="itemscope" itemtype="http://schema.org/Organization">
                            <div>
                                <h6 class="o_wevent_sidebar_title">Organizer</h6>
                            </div>
                            <div itemprop="name" class="mb-1" t-field="event.organizer_id"/>
                            <small t-field="event.organizer_id" t-options="{'widget': 'contact', 'fields': ['phone', 'mobile', 'email'], 'with_microdata': True,}"/>
                        </div>
                        <!-- Social -->
                        <div t-if="opt_event_share_block" class="o_wevent_sidebar_block">
                            <div>
                                <h6 class="o_wevent_sidebar_title">Share</h6>
                                <p>Find out what people see and say about this event, and join the conversation.</p>
                            </div>
                            <t t-snippet-call="website.s_share">
                                <t t-set="_no_title" t-value="True"/>
                                <t t-set="_classes" t-valuef="o_wevent_sidebar_social mx-n1"/>
                                <t t-set="_link_classes" t-valuef="o_wevent_social_link"/>
                            </t>
                        </div>
                    </aside>
                </div>
            </div>
        </section>
    </t>
</t>

