Files
odoo_source/addons/website_event/views/event_templates_widgets.xml
T
Julien Banken 0f50285cf6 [IMP] website_event_track[_live]: add visual & usability improvements to event.tracks
PURPOSE

This commit adds several minor visual improvements to the event.tracks
frontend and backend views as well as a few quality of life changes to
ease usability.

SPECS

- Add "hide and show" feature for tracks

In the event homepage, all the tracks of the selected event will be
displayed. As the tracks are grouped by day, some sections will only
contain tracks that have already taken place. If there are a lot of
tracks, it might be better to fold these sections to reduce the payload
of the page. That way, the user will be able to see the upcoming tracks
more easily.

With these changes, a new chevron icon will be added above each section.
When the user clicks on it, the user can fold and unfold a section.
By default, the section containing tracks that have already taken place
will be initially folded.

- Add partner tag line

The user may need to know more about the speaker before attending a
talk. The user may wonder: Who will give the talk ? What is his/her
field of expertise ? Where the speaker comes from ? To answer these
questions, we will display: the name, the job position and
the company name of the speaker.

- Add replay suggestion when no suggestion can be provided

When a video ends and no suggestion can be provided, the player will
display an empty cover to hide the Youtube suggestions. With these new
changes, the cover will now suggest the user to replay the video when
no suggestion can be provided.

- Dynamic count down for incoming tracks

When the user accesses a track that will start in several hours, an alert
will indicate the remaining time before the beginning of the track.
Unfortunately, this alert is not dynamic: If the user keeps the page in
a tab and come back later, the alert will not be updated and will display
an incorrect estimation.

The changes address this issue: The timer will now be updated dynamically
as the time goes on. When the countdown reaches 0, the alert will
automatically be removed from the dom.

- Fix links of the agenda view

In the agenda, the title of a track can be a link. When the user hover
it, the cursor of the user will now turn into a clickable hand only if
the track is accessible.

- Remove the default date for the new tracks.
- Set a default duration of half an hour for the new tracks.

LINKS

Task-2347597
COM PR odoo/odoo#69102
ENT PR odoo/enterprise#17612

X-original-commit: 6804b8a92c03db09c2694150f968d8056492a1d4
2021-04-12 10:39:58 +00:00

91 lines
4.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Search Box -->
<template id="events_search_box" inherit_id="website.website_search_box" primary="True">
<xpath expr="//div[@role='search']" position="replace">
<form t-attf-class="o_wevent_event_searchbar_form o_wait_lazy_js w-100 my-1 my-lg-0 #{_classes}"
t-att-action="action if action else '/event'" method="get">
<t t-set="search" t-value="search or _searches and _searches['search']"/>
<t t-set="placeholder" t-value="placeholder or _placeholder"/>
<t>$0</t>
<t t-foreach="_searches" t-as="search">
<input t-if="search != 'search' and search_value != 'all'" type="hidden"
t-att-name="search" t-att-value="search_value"/>
</t>
<t t-raw="0"/>
</form>
</xpath>
</template>
<!-- Snippet - Country Events - List -->
<template id="country_events_list" name="Country Events List">
<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 t-esc="event_dict['event'].name" t-attf-class="#{(not event_dict['event'].website_published) and 'text-danger' or ''}"/>
</a>
<span 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 href="/event" class="small"><b>View all</b></a>
</t>
</div>
</t>
</div>
</template>
<!-- Timer widget -->
<template id="display_timer_widget" name="Display Timer Widget">
<t t-set="pre_countdown_display" t-value="bool(pre_countdown_text) or pre_countdown_display"/>
<t t-set="pre_countdown_time" t-value="datetime.datetime.now().timestamp() + int(pre_remaining_time)"/>
<div class="o_display_timer"
t-att-data-display-class="display_class"
t-att-data-main-countdown-time="datetime.datetime.now().timestamp() + int(main_remaining_time)"
t-att-data-main-countdown-text="main_countdown_text"
t-att-data-main-countdown-display="main_countdown_display"
t-att-data-pre-countdown-time="pre_countdown_time"
t-att-data-pre-countdown-display="pre_countdown_display"
t-att-data-pre-countdown-text="pre_countdown_text">
<t t-set="remaining_time" t-value="pre_remaining_time if pre_remaining_time else main_remaining_time"/>
<span class="o_display_timer_countdown d-flex justify-content-center">
<span class="o_countdown_text pr-1" t-esc="pre_countdown_text if pre_countdown_text else main_countdown_text if not pre_countdown_display else ''"/>
<div t-if="int(remaining_time) > 86400"
class="o_countdown_metric_container"><span class="o_countdown_remaining o_timer_days pr-1">0</span><span class="o_countdown_metric pr-1">days</span></div>
<div t-if="int(remaining_time) > 3600"
class="o_countdown_metric_container"><span class="o_countdown_remaining o_timer_hours">00</span><span class="o_countdown_metric">:</span></div>
<div class="o_countdown_metric_container"><span class="o_countdown_remaining o_timer_minutes">00</span><span class="o_countdown_metric">:</span></div>
<div class="o_countdown_metric_container"><span class="o_countdown_remaining o_timer_seconds">00</span><span class="o_countdown_metric"></span></div>
</span>
</div>
</template>
<template id="display_timer_alert_widget" name="Display Countdown widget">
<div class="o_we_track_timer alert alert-warning alert-dismissible fade show d-none mx-3 mt-3 mb-0" role="alert" t-att-data-time-to-live="time_to_live">
Starts <span />
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<i class="fa fa-times"/>
</button>
</div>
</template>
</odoo>