[FIX] website_event_{meet, track_exhibitor}: show a warning message when the event is finished

Bug
===

If the event is finished, we should not display the warning message "The
Event starts on...". Instead, we should say that the event is over.

We therefore better handle timeframes.

Task ID-2345894
PR #58516

X-original-commit: 7a41dadd9fbfb4643d981d9e9eba90befad3e013
This commit is contained in:
std-odoo
2020-09-29 12:08:34 +00:00
committed by Thibault Delavallée
parent bee0b4b6ad
commit 873e1dedf5
5 changed files with 77 additions and 46 deletions
@@ -67,10 +67,17 @@
</div>
</nav>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">&amp;times;</button>
<span>This room is not open right now!</span><br />
Join us here on the
<strong itemprop="startDate" t-field="event.with_context(tz=event.date_tz).date_begin" t-options="{'format': 'medium'}"/>
to have a chat with us!
<t t-if="not event.is_done">
<span>This room is not open right now!</span><br />
Join us here on the
<strong itemprop="startDate" t-field="event.with_context(tz=event.date_tz).date_begin" t-options="{'format': 'medium'}"/>
to have a chat with us!
</t>
<t t-else="">
Event <span t-esc="event.name" class="font-weight-bold"/> is over.
<br/>
<span>Join us next time to chat about <b t-esc="meeting_room.name"/>!</span>
</t>
</div>
<div class="modal-body row">
@@ -30,21 +30,28 @@
<template id="meeting_room_main" name="Meeting Room: Main Content">
<div t-att-class="'col-12 o_wevent_online_page_main o_wemeet_room_main bg-white p-0 %s' % ('col-md-9 col-lg-10' if option_widescreen else 'col-md-8 col-lg-9')">
<!-- EVENT NOT STARTED ALERTS -->
<div t-if="not meeting_room.event_id.is_ongoing" class="alert alert-warning text-center">
The event <span t-esc="meeting_room.event_id.name" class="font-weight-bold"/>
<span t-if="meeting_room.event_id.start_today">
starts in
<span t-esc="meeting_room.event_id.start_remaining"
t-options="{'widget': 'duration', 'digital': True, 'unit': 'minute', 'round': 'minute'}"/>.
</span>
<span class="my-0" t-else="meeting_room.event_id.start_today">
starts on
<span t-field="meeting_room.event_id.with_context(tz=meeting_room.event_id.date_tz).date_begin"
t-options="{'format': 'medium'}"/> (<t t-esc="meeting_room.event_id.date_tz"/>).
</span>
<br/>
<span>Join us there to chat about <b t-esc="meeting_room.name"/> !</span>
</div>
<t t-if="not meeting_room.event_id.is_ongoing">
<div t-if="meeting_room.event_id.is_done" class="alert alert-warning text-center">
The event <span t-esc="meeting_room.event_id.name" class="font-weight-bold"/> is over.
<br/>
<span>Join us next time to chat about <b t-esc="meeting_room.name"/>!</span>
</div>
<div t-else="" class="alert alert-warning text-center">
The event <span t-esc="meeting_room.event_id.name" class="font-weight-bold"/>
<span t-if="meeting_room.event_id.start_today">
starts in
<span t-esc="meeting_room.event_id.start_remaining"
t-options="{'widget': 'duration', 'digital': True, 'unit': 'minute', 'round': 'minute'}"/>.
</span>
<span class="my-0" t-else="meeting_room.event_id.start_today">
starts on
<span t-field="meeting_room.event_id.with_context(tz=meeting_room.event_id.date_tz).date_begin"
t-options="{'format': 'medium'}"/> (<t t-esc="meeting_room.event_id.date_tz"/>).
</span>
<br/>
<span>Join us there to chat about <b t-esc="meeting_room.name"/> !</span>
</div>
</t>
<!-- ROOM CONTENT -->
<div class="d-flex flex-column">
<div t-if="meeting_room.room_is_full and not is_event_manager" class="alert alert-warning text-center">
@@ -193,6 +193,7 @@ class ExhibitorController(EventTrackController):
sponsor_data['sponsor_type_id'] = False
sponsor_data['event_name'] = sponsor.event_id.name
sponsor_data['event_is_ongoing'] = sponsor.event_id.is_ongoing
sponsor_data['event_is_done'] = sponsor.event_id.is_done
sponsor_data['event_start_today'] = sponsor.event_id.start_today
sponsor_data['event_start_remaining'] = sponsor.event_id.start_remaining
sponsor_data['event_date_begin_located'] = sponsor.event_id.date_begin_located
@@ -4,18 +4,27 @@
<t t-name="exhibitor.connect.closed.modal">
<div class="o_wesponsor_js_connect_modal_main container">
<div class="row mt-2">
<div class="col-12 alert alert-warning text-center" role="alert"
t-if="! widget.sponsorData.event_is_ongoing">
<span t-esc="widget.sponsorData.name" class="font-weight-bold"/> is not available right now.<br />
Event <span t-esc="widget.sponsorData.event_name" class="font-weight-bold"/>
<span t-if="widget.sponsorData.event_start_today">
starts in
<span t-esc="widget.sponsorData.event_start_remaining"/> minutes
</span>
<span class="my-0" t-else="">
starts on <span t-esc="widget.sponsorData.event_date_begin_located"/>
</span>
</div>
<t t-if="! widget.sponsorData.event_is_ongoing">
<div class="col-12 alert alert-warning text-center" role="alert"
t-if="widget.sponsorData.event_is_done">
Event <span t-esc="widget.sponsorData.event_name" class="font-weight-bold"/> is over.
<br/>
<span>Join us next time to meet <b t-esc="widget.sponsorData.name"/>!</span>
</div>
<div class="col-12 alert alert-warning text-center" role="alert"
t-else="">
<span t-esc="widget.sponsorData.name" class="font-weight-bold"/> is not available right now.<br />
Event <span t-esc="widget.sponsorData.event_name" class="font-weight-bold"/>
<span t-if="widget.sponsorData.event_start_today">
starts in
<span t-esc="widget.sponsorData.event_start_remaining"/> minutes
</span>
<span class="my-0" t-else="">
starts on <span t-esc="widget.sponsorData.event_date_begin_located"/>
</span>
</div>
</t>
<div class="col-12 alert alert-warning text-center" role="alert"
t-else="">
<span t-esc="widget.sponsorData.name" class="font-weight-bold"/> is not available right now.<br />
@@ -30,21 +30,28 @@
<template id="exhibitor_main" name="Exhibitor: Main Content">
<div t-att-class="'col-12 o_wevent_online_page_main o_wesponsor_exhibitor_main bg-white p-0 %s' % ('col-md-9 col-lg-10' if option_widescreen else 'col-md-8 col-lg-9')">
<!-- EVENT NOT STARTED ALERTS -->
<div t-if="not sponsor.event_id.is_ongoing" class="alert alert-warning rounded-0 text-center" role="alert">
Event <span t-esc="sponsor.event_id.name" class="font-weight-bold"/>
<span t-if="sponsor.event_id.start_today">
starts in
<span t-esc="sponsor.event_id.start_remaining"
t-options="{'widget': 'duration', 'digital': True, 'unit': 'minute', 'round': 'minute'}"/>.
</span>
<span class="my-0" t-else="">
starts on
<span t-field="sponsor.event_id.with_context(tz=sponsor.event_id.date_tz).date_begin"
t-options="{'format': 'medium'}"/> (<t t-esc="sponsor.event_id.date_tz"/>).
</span>
<br/>
<span>Join us there to meet <b t-esc="sponsor.partner_name"/> !</span>
</div>
<t t-if="not sponsor.event_id.is_ongoing">
<div t-if="sponsor.event_id.is_done" class="alert alert-warning rounded-0 text-center" role="alert">
Event <span t-esc="sponsor.event_id.name" class="font-weight-bold"/> is over.
<br/>
<span>Join us next time to meet <b t-esc="sponsor.partner_name"/>!</span>
</div>
<div t-else="" class="alert alert-warning rounded-0 text-center" role="alert">
Event <span t-esc="sponsor.event_id.name" class="font-weight-bold"/>
<span t-if="sponsor.event_id.start_today">
starts in
<span t-esc="sponsor.event_id.start_remaining"
t-options="{'widget': 'duration', 'digital': True, 'unit': 'minute', 'round': 'minute'}"/>.
</span>
<span class="my-0" t-else="">
starts on
<span t-field="sponsor.event_id.with_context(tz=sponsor.event_id.date_tz).date_begin"
t-options="{'format': 'medium'}"/> (<t t-esc="sponsor.event_id.date_tz"/>).
</span>
<br/>
<span>Join us there to meet <b t-esc="sponsor.partner_name"/> !</span>
</div>
</t>
<!-- SPONSOR JITSI + CLOSED/FULL ALERTS -->
<div t-if="sponsor.event_id.is_ongoing and sponsor.chat_room_id" class="d-flex flex-column">
<t t-if="not sponsor.is_in_opening_hours">