<odoo>
<!-- Snippet - Country booking events - Placeholder -->
<template id="s_country_booking_events" name="Booking Events">
    <div class="s_country_booking_events_list oe_country_booking_events #{_classes}">
        <div class="country_booking_events_list">
            <h6 class="o_wevent_sidebar_title">
                <i class="fa fa-globe mr-2"/>Upcoming booking Events
            </h6>
        </div>
    </div>
</template>


<template id="snippets" inherit_id="website_event.snippets">
    <xpath expr="//t[@t-snippet='website_event.s_country_events']" position="before">
         <t t-snippet="kalachakra.s_country_booking_events" t-thumbnail="/website_event/static/src/img/snippets_thumbs/s_country_events.svg"/>
    </xpath>
    
</template>


    


<template id="snippet_options" inherit_id="website.snippet_options">
    <xpath expr="//*[@t-set='so_content_addition_selector']" position="inside">,.oe_country_booking_events</xpath>
</template>

<template id="country_events_list" inherit_id="website_event.country_events_list">
    <xpath expr="//div[@class='country_events_list']" position="replace">
        <div class="country_events_list">
        <t t-if="events">
            <h6 class="o_wevent_sidebar_title">
                <t t-if="country">
                    <i class="fa fa-flag mr-2"/>Events: <span t-esc="country.name"/>
                    <img class="img-fluid" t-att-src="website.image_url(country, 'image')" alt=""/>
                </t>
                <t t-else="">
                    <i class="fa fa-globe mr-2"/>Upcoming Events
                </t>
            </h6>
            <ul class="list-group mb-3">
                <li t-foreach="events[:5]" t-as="event_dict" class="list-group-item d-flex justify-content-between">
                    <a t-att-href="event_dict['url']">
                        <i t-if="not event_dict['event'].website_published" class="fa fa-ban text-danger mr-1" role="img" aria-label="Unpublished" title="Unpublished"/>
                        <span style="font-size: 18px;" t-esc="event_dict['event'].name" t-attf-class="#{(not event_dict['event'].website_published) and 'text-danger' or ''}"/>
                    </a>
                    <span style="font-size: 18px;" t-esc="event_dict['date']"/>
                </li>
            </ul>
            <div t-if="len(events) &gt; 5">
                <t t-if="country">
                    <a t-attf-href="/event?country=#{country.id}" class="small"><b>See all events from <span t-esc="country.name"/></b></a>
                </t>
                <t t-else="">
                    <a  style="font-size: 18px;" href="/event" class="small"><b>View all</b></a>
                </t>
            </div>
            <br></br>
            <h6 class="o_wevent_sidebar_title">
            
                <t t-if="country">
                    <i class="fa fa-flag mr-2"/>Events: <span t-esc="country.name"/>
                    <img class="img-fluid" t-att-src="website.image_url(country, 'image')" alt=""/>
                </t>
                <t t-else="">
                    <i class="fa fa-globe mr-2"/>Next week-end events
                </t>
            </h6>
            
            <ul class="list-group mb-3">
            <t t-foreach="events" t-as="event_dict">
            <t t-if="event_dict['next_weekend_evt']==1">
                <li  class="list-group-item d-flex justify-content-between">
                <!-- <span style="font-size: 18px;" t-esc="event_dict['d_day']"/> -->
                    <a t-att-href="event_dict['url']">
                        <i t-if="not event_dict['event'].website_published" class="fa fa-ban text-danger mr-1" role="img" aria-label="Unpublished" title="Unpublished"/>
                        <span style="font-size: 18px;" t-esc="event_dict['event'].name" t-attf-class="#{(not event_dict['event'].website_published) and 'text-danger' or ''}"/>
                    </a>
                    <span style="font-size: 18px;" t-esc="event_dict['date']"/>
                
                </li>
            </t>
            </t>
                
            </ul>
            
            
        </t>
    </div>
    </xpath>
</template>


<template id="country_booking_events_list" name="Country Booking Events List">
    <div class="country_booking_events_list">
        <t t-if="events">
            <h6 class="o_wevent_sidebar_title">
                <t t-if="country">
                    <i class="fa fa-flag mr-2"/>Booking events: <span t-esc="country.name"/>
                    <img class="img-fluid" t-att-src="website.image_url(country, 'image')" alt=""/>
                </t>
                <t t-else="">
                    <i class="fa fa-globe mr-2"/>Upcoming Booking events
                </t>
            </h6>
            <ul class="list-group mb-3">
                <li t-foreach="events[:5]" t-as="event_dict" class="list-group-item d-flex justify-content-between">
                    <a t-att-href="event_dict['url']">
                        <i t-if="not event_dict['event'].website_published" class="fa fa-ban text-danger mr-1" role="img" aria-label="Unpublished" title="Unpublished"/>
                        <span style="font-size: 18px;" t-esc="event_dict['event'].name" t-attf-class="#{(not event_dict['event'].website_published) and 'text-danger' or ''}"/>
                    </a>
                    <span style="font-size: 18px;" t-esc="event_dict['date']"/>
                    
                </li>
            </ul>
            <div t-if="len(events) &gt; 5">
                <t t-if="country">
                    <a t-attf-href="/event?country=#{country.id}" class="small"><b>See all events from <span t-esc="country.name"/></b></a>
                </t>
                <t t-else="">
                    <a style="font-size: 18px;" href="/event?tags=Retraite" class="small"><b>View all</b></a>
                </t>
            </div>
        </t>
    </div>
</template>

</odoo>