summaryrefslogtreecommitdiff
path: root/addons/website_event_track_live/views
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/website_event_track_live/views
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/website_event_track_live/views')
-rw-r--r--addons/website_event_track_live/views/assets.xml14
-rw-r--r--addons/website_event_track_live/views/event_track_templates_list.xml22
-rw-r--r--addons/website_event_track_live/views/event_track_templates_page.xml60
-rw-r--r--addons/website_event_track_live/views/event_track_views.xml16
4 files changed, 112 insertions, 0 deletions
diff --git a/addons/website_event_track_live/views/assets.xml b/addons/website_event_track_live/views/assets.xml
new file mode 100644
index 00000000..0e7e85ce
--- /dev/null
+++ b/addons/website_event_track_live/views/assets.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<odoo>
+
+<template id="assets_frontend" inherit_id="website.assets_frontend" name="Event Track Live Assets Frontend">
+ <xpath expr="//link[last()]" position="after">
+ <link rel="stylesheet" href="/website_event_track_live/static/src/scss/website_event_track_live.scss"/>
+ </xpath>
+ <xpath expr="//script[last()]" position="after">
+ <script type="text/javascript" src="/website_event_track_live/static/src/js/website_event_track_suggestion.js"></script>
+ <script type="text/javascript" src="/website_event_track_live/static/src/js/website_event_track_live.js"></script>
+ </xpath>
+</template>
+
+</odoo>
diff --git a/addons/website_event_track_live/views/event_track_templates_list.xml b/addons/website_event_track_live/views/event_track_templates_list.xml
new file mode 100644
index 00000000..64e62053
--- /dev/null
+++ b/addons/website_event_track_live/views/event_track_templates_list.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+<template id="tracks_display_list" inherit_id="website_event_track.tracks_display_list">
+ <!-- TRACK LIST: ADD REPLAY TAG FOR FINISHED TRACKS -->
+ <xpath expr="//div[@t-foreach='tracks']//div[hasclass('col-md-7')]//span[@t-elif='not track.is_track_done and not track.is_track_soon']" position="after">
+ <a t-elif="track.youtube_video_url and (track.is_published or user_event_manager)"
+ t-att-href="track.website_url" class="badge badge-danger ml-2">Replay
+ </a>
+ </xpath>
+ <!-- ADD YOUTUBE ICON -->
+ <xpath expr="//div[@t-foreach='tracks']//div[hasclass('col-md-7')]//a/span[@t-field='track.name']" position="before">
+ <i t-if="track.date and track.youtube_video_url and (track.is_track_soon or track.is_track_live or track.is_youtube_replay)"
+ class="fa fa-youtube-play text-danger mr-1"/>
+ </xpath>
+ <xpath expr="//div[@t-foreach='tracks']//div[hasclass('col-md-7')]//t/span[@t-field='track.name']" position="before">
+ <i t-if="track.date and track.youtube_video_url and (track.is_track_soon or track.is_track_live or track.is_youtube_replay)"
+ class="fa fa-youtube-play text-danger mr-1"/>
+ </xpath>
+</template>
+
+</odoo>
diff --git a/addons/website_event_track_live/views/event_track_templates_page.xml b/addons/website_event_track_live/views/event_track_templates_page.xml
new file mode 100644
index 00000000..37dd813c
--- /dev/null
+++ b/addons/website_event_track_live/views/event_track_templates_page.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+<!-- MAIN: REMOVE HEADER/FOOTER IF WIDESCREEN -->
+<template id="event_track_main" inherit_id="website_event_track.event_track_main">
+ <xpath expr="//t[@t-call='website_event.layout']" position="before">
+ <t t-set="no_header" t-value="option_widescreen"/>
+ <t t-set="no_footer" t-value="option_widescreen"/>
+ </xpath>
+</template>
+
+<!-- MAIN: ADD VIDEO -->
+<template id="event_track_content" inherit_id="website_event_track.event_track_content">
+ <!-- Do not display "starting in" in case of replay mode as video is already available -->
+ <xpath expr="//div[@t-elif='track.track_start_remaining']" position="attributes">
+ <attribute name="t-elif">track.track_start_remaining and not track.is_youtube_replay</attribute>
+ </xpath>
+ <!-- Add video -->
+ <xpath expr="//div[@name='o_wesession_track_main']//div" position="before">
+ <t t-set="show_youtube_frame" t-value="track.youtube_video_url and (track.is_youtube_replay or track.is_track_soon or track.is_track_live or track.is_track_done)" />
+ <div t-if="show_youtube_frame" class="flex-grow-1 o_wevent_event_track_live"
+ t-att-data-track-id="track.id"
+ t-att-data-youtube-video-id="track.youtube_video_id"
+ t-att-data-has-next-suggestion="bool(track._get_track_suggestions(restrict_domain=[('youtube_video_url', '!=', False), ('is_published', '=', True)], limit=1))">
+ <div class="position-absolute o_wevent_event_track_live_loading w-100 d-flex align-items-center justify-content-center text-white h4">
+ <i class="fa fa-spin fa-spinner position-relative"/>
+ <span class="pl-2">Loading Video...</span>
+ </div>
+ <div id="o_wevent_youtube_iframe_container" class="w-100"/>
+ </div>
+ </xpath>
+</template>
+
+<!-- ASIDE: ADD CHAT TAB FOR VIDEOS -->
+<template id="event_track_aside" inherit_id="website_event_track.event_track_aside">
+ <xpath expr="//ul[hasclass('o_wesession_track_aside_nav')]/li" position="before">
+ <li t-if="track.is_youtube_chat_available and not is_mobile_chat_disabled" class="nav-item flex-grow-1">
+ <a href="#track_chat" aria-controls="track_chat" class="nav-link active" role="tab" data-toggle="tab">
+ Chat
+ </a>
+ </li>
+ </xpath>
+ <xpath expr="//a[@href='#track_list']" position="attributes">
+ <attribute name="t-attf-class">#{'nav-link' if track.is_youtube_chat_available and not is_mobile_chat_disabled else 'nav-link active'}</attribute>
+ </xpath>
+ <xpath expr="//div[hasclass('o_wesession_track_aside_tabs')]" position="inside">
+ <div t-if="track.is_youtube_chat_available and not is_mobile_chat_disabled" id="track_chat"
+ class="tab-pane fade show active o_wesession_track_aside_tab_chat" role="tabpanel">
+ <iframe t-attf-src="https://www.youtube.com/live_chat?v=#{track.youtube_video_id}&amp;embed_domain=#{hostname}"
+ height="100%"
+ width="100%"
+ frameborder="0" allowfullscreen="allowfullscreen"/>
+ </div>
+ </xpath>
+ <xpath expr="//div[@id='track_list']" position="attributes">
+ <attribute name="t-attf-class">#{'tab-pane fade' if track.is_youtube_chat_available and not is_mobile_chat_disabled else 'tab-pane fade show active'}</attribute>
+ </xpath>
+</template>
+
+</odoo>
diff --git a/addons/website_event_track_live/views/event_track_views.xml b/addons/website_event_track_live/views/event_track_views.xml
new file mode 100644
index 00000000..9ac764c7
--- /dev/null
+++ b/addons/website_event_track_live/views/event_track_views.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<odoo>
+
+ <record id="event_track_view_form" model="ir.ui.view">
+ <field name="name">event.track.view.form.inherit.live</field>
+ <field name="model">event.track</field>
+ <field name="inherit_id" ref="website_event_track.view_event_track_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='active']" position="after">
+ <field name="youtube_video_url" widget="url" />
+ <field name="is_youtube_replay" attrs="{'invisible': [('youtube_video_url', '=', '')]}" />
+ </xpath>
+ </field>
+ </record>
+
+</odoo>