[MOV] website_event: reorganize module content
PURPOSE Clean organization and models linked to Event Online feature introduced in semi stable saas-13.3 at odoo/odoo@981f95bbf4 and odoo/enterprise@14722028ae Also clean website event menu not being available in website event but only in website event track, which implies some extra-code to manage it. In short: merge website_event_online in website_event, website_event_track _(online/session) in website_event_track. RATIONALE _online modules have been added to extend content of website_event and website_event_track without having any impact on those module. First step of cleaning is to move this content directly in base module. track_session module is mainly a rewrite of track module. Second step of cleaning is to move its content directly in website_event_track. SPECIFICATIONS Quickly reorganize some bits of code in website_event module to ease future integration of code from _online sub-modules. It also helps understanding and finding its way through the module. Split python files by model: notably event.type outside of event.event file and code. Reorganize templates by main use * _list: list view of events; * _page: page view of events, either event itself or registration flow (_page_registration); * move side templates in side files; LINKS Task ID-2319779 COM odoo/odoo#56067 ENT odoo/enterprise#12520 UPG odoo/upgrade#1654
This commit is contained in:
@@ -1,23 +1,33 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
{
|
||||
'name': 'Events',
|
||||
'version': '1.1',
|
||||
'category': 'Marketing/Events',
|
||||
'sequence': 140,
|
||||
'summary': 'Publish events, sell tickets',
|
||||
'website': 'https://www.odoo.com/page/events',
|
||||
'description': "",
|
||||
'depends': ['website', 'website_partner', 'website_mail', 'event'],
|
||||
'depends': [
|
||||
'event',
|
||||
'website',
|
||||
'website_partner',
|
||||
'website_mail',
|
||||
],
|
||||
'data': [
|
||||
'data/event_data.xml',
|
||||
'views/assets.xml',
|
||||
'views/res_config_settings_views.xml',
|
||||
'views/event_snippets.xml',
|
||||
'views/event_templates.xml',
|
||||
'views/event_templates_misc_pages.xml',
|
||||
'views/event_templates_registration.xml',
|
||||
'views/event_templates_list.xml',
|
||||
'views/event_templates_page.xml',
|
||||
'views/event_templates_page_registration.xml',
|
||||
'views/event_templates_page_misc.xml',
|
||||
'views/event_templates_widgets.xml',
|
||||
'views/website_templates.xml',
|
||||
'views/event_views.xml',
|
||||
'views/event_event_views.xml',
|
||||
'views/event_type_views.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'security/event_security.xml',
|
||||
],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import event_event
|
||||
from . import event_type
|
||||
from . import website
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
import werkzeug.urls
|
||||
import json
|
||||
import werkzeug.urls
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.addons.http_routing.models.ir_http import slug
|
||||
@@ -10,16 +10,14 @@ from odoo.addons.http_routing.models.ir_http import slug
|
||||
GOOGLE_CALENDAR_URL = 'https://www.google.com/calendar/render?'
|
||||
|
||||
|
||||
class EventType(models.Model):
|
||||
_name = 'event.type'
|
||||
_inherit = ['event.type']
|
||||
|
||||
website_menu = fields.Boolean('Display a dedicated menu on Website')
|
||||
|
||||
|
||||
class Event(models.Model):
|
||||
_name = 'event.event'
|
||||
_inherit = ['event.event', 'website.seo.metadata', 'website.published.multi.mixin', 'website.cover_properties.mixin']
|
||||
_inherit = [
|
||||
'event.event',
|
||||
'website.seo.metadata',
|
||||
'website.published.multi.mixin',
|
||||
'website.cover_properties.mixin'
|
||||
]
|
||||
|
||||
def _default_cover_properties(self):
|
||||
res = super()._default_cover_properties()
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class EventType(models.Model):
|
||||
_name = 'event.type'
|
||||
_inherit = ['event.type']
|
||||
|
||||
website_menu = fields.Boolean('Display a dedicated menu on Website')
|
||||
-24
@@ -1,30 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="event_type_view_form_inherit_website" model="ir.ui.view">
|
||||
<field name="name">event.type.view.form.inherit.website</field>
|
||||
<field name="model">event.type</field>
|
||||
<field name="inherit_id" ref="event.view_event_type_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<div name="event_type_visibility_seats" position="after">
|
||||
<div class="col-12 col-lg-6 o_setting_box" name="event_type_visibility_website">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="website_menu"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="website_menu"/>
|
||||
<div class="row" name="website_menu">
|
||||
<div class="col-lg-8 mt16 text-muted">
|
||||
Check this option to have menus for your event on the
|
||||
website: registrations, schedule, map, ...
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="event_event_view_form_inherit_website" model="ir.ui.view">
|
||||
<field name="name">event.event.view.form.inherit.website</field>
|
||||
<field name="model">event.event</field>
|
||||
@@ -12,40 +12,6 @@
|
||||
</div>
|
||||
</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) > 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>
|
||||
|
||||
<!-- Snippets and options -->
|
||||
<template id="snippets" inherit_id="website.snippets">
|
||||
<xpath expr="//t[@id='event_local_events_hook']" position="replace">
|
||||
|
||||
-166
@@ -144,23 +144,6 @@
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<!-- Index - Events list -->
|
||||
<template id="events_list" name="Events list">
|
||||
<!-- Options -->
|
||||
@@ -343,153 +326,4 @@
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- Event -->
|
||||
<template id="layout" name="Event">
|
||||
<t t-call="website.layout">
|
||||
<!-- Options -->
|
||||
<t t-set="opt_events_list_categories" t-value="request.website.viewref('website_event.opt_events_list_categories').active"/>
|
||||
<div id="wrap" class="o_wevent_event js_event">
|
||||
<t t-if="not event.menu_id">
|
||||
<nav class="navbar navbar-light border-top shadow-sm d-print-none">
|
||||
<div class="container align-items-baseline justify-content-start">
|
||||
<a href="/event" class="navbar-brand h4 my-0 mr-0 mr-md-4">
|
||||
<i class="fa fa-long-arrow-left text-primary mr-2"/>
|
||||
<span>All Events</span>
|
||||
</a>
|
||||
<ul class="navbar-nav flex-row ml-md-auto ml-0">
|
||||
<li t-if="opt_events_list_categories" class="nav-item mr-3">
|
||||
<a t-attf-href="/event?type=#{event.event_type_id.id}" t-if="event.event_type_id" class="nav-link">
|
||||
<i class="fa fa-folder-open text-primary mr-2"/><span t-field="event.event_type_id"/>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item mr-3">
|
||||
<a t-if="event.country_id" t-attf-href="/event?country=#{event.country_id.id}" class="nav-link">
|
||||
<i class="fa fa-map-marker text-primary mr-2"/><span t-field="event.country_id"/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="d-flex align-items-centerflex-wrap pl-sm-3 pr-0">
|
||||
<t t-call="website_event.events_search_box">
|
||||
<t t-set="_classes" t-value="'ml-auto'"/>
|
||||
<t t-set="_searches" t-value="searches"/>
|
||||
<t t-set="_placeholder">Search an event ...</t>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<nav class="navbar navbar-light border-top shadow-sm navbar-expand-md">
|
||||
<div class="container align-items-baseline">
|
||||
<a href="#" t-field="event.name" class="navbar-brand h4 my-0 mr-0 mr-md-4"/>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#o_wevent_event_submenu" aria-controls="o_wevent_event_submenu" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div id="o_wevent_event_submenu" class="collapse navbar-collapse">
|
||||
<ul class="navbar-nav w-100" t-att-data-menu_name="editable and 'Event Menu'" t-att-data-content_menu_id="editable and event.menu_id.id">
|
||||
<t t-foreach="event.menu_id.child_id" t-as="submenu">
|
||||
<t t-call="website.submenu">
|
||||
<t t-set="item_class" t-value="'nav-item'"/>
|
||||
<t t-set="link_class" t-value="'nav-link'"/>
|
||||
</t>
|
||||
</t>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</t>
|
||||
<t t-raw="0"/>
|
||||
<t t-set="editor_sub_message">Following content will appear on all events.</t>
|
||||
<div class="oe_structure oe_empty" id="oe_structure_website_event_layout_1" t-att-data-editor-sub-message="editor_sub_message"/>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<!-- Event - Description -->
|
||||
<template id="event_description_full" name="Event Description" track="1">
|
||||
<t t-call="website_event.event_details">
|
||||
<section class="bg-200 mt-n5">
|
||||
<div class="container overflow-hidden">
|
||||
<div class="row no-gutters mt-n4 mb-3">
|
||||
<!-- Description -->
|
||||
<div id="o_wevent_event_main_col" class="col-lg-8 bg-white px-3 pt-5 pb-0 shadow-sm">
|
||||
<span t-field="event.description" itemprop="description"/>
|
||||
</div>
|
||||
<div class="col-lg-4 bg-light shadow-sm d-print-none">
|
||||
<!-- Date & Time -->
|
||||
<div class="o_wevent_sidebar_block">
|
||||
<h6 class="o_wevent_sidebar_title">Date & Time</h6>
|
||||
<div class="d-flex">
|
||||
<h5 t-field="event.with_context(tz=event.date_tz).date_begin" class="my-1 mr-1" t-options="{'date_only': 'true', 'format': 'EEEE'}"/>
|
||||
<h5 class="my-1" t-field="event.with_context(tz=event.date_tz).date_begin" t-options="{'date_only': 'true', 'format': 'long'}" itemprop="startDate" t-att-datetime="event.date_begin"/>
|
||||
</div>
|
||||
<t t-if="not event.is_one_day">Start -</t>
|
||||
<span t-field="event.with_context(tz=event.date_tz).date_begin" t-options="{'time_only': 'true', 'format': 'short'}"/>
|
||||
<t t-if="event.is_one_day">
|
||||
<i class="fa fa-long-arrow-right mx-1"/>
|
||||
<span t-field="event.with_context(tz=event.date_tz).date_end" t-options="{'time_only': 'true', 'format': 'short'}"/>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<i class="fa fa-long-arrow-down d-block text-muted mx-3 my-2" style="font-size: 1.5rem"/>
|
||||
<div class="d-flex">
|
||||
<h5 t-field="event.with_context(tz=event.date_tz).date_end" class="my-1 mr-1" t-options="{'date_only': 'true', 'format': 'EEEE'}"/>
|
||||
<h5 class="my-1" t-field="event.with_context(tz=event.date_tz).date_end" t-options="{'date_only': 'true', 'format': 'long'}"/>
|
||||
</div>
|
||||
<t t-if="not event.is_one_day">End -</t>
|
||||
<span t-field="event.with_context(tz=event.date_tz).date_end" t-options="{'time_only': 'true', 'format': 'short'}"/>
|
||||
</t>
|
||||
<!-- Timezone -->
|
||||
<small t-esc="event.date_tz" class="d-block my-3 text-muted"/>
|
||||
|
||||
<div class="dropdown">
|
||||
<i class="fa fa-calendar mr-1"/>
|
||||
<a href="#" role="button" data-toggle="dropdown">Add to Calendar</a>
|
||||
<div class="dropdown-menu">
|
||||
<a t-att-href="iCal_url" class="dropdown-item">iCal/Outlook</a>
|
||||
<a t-att-href="google_url" class="dropdown-item" target="_blank">Google</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Location -->
|
||||
<div t-if="event.address_id" class="o_wevent_sidebar_block">
|
||||
<h6 class="o_wevent_sidebar_title">Location</h6>
|
||||
<h4 t-field="event.address_id" class="" t-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["name"]
|
||||
}'/>
|
||||
<div itemprop="location" class="mb-2" t-field="event.address_id" t-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["address"],
|
||||
"no_marker": True
|
||||
}'/>
|
||||
<div class="mb-3" t-field="event.address_id" t-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["phone", "mobile", "email"]
|
||||
}'/>
|
||||
<i class="fa fa-map-marker fa-fw" role="img"/>
|
||||
<a t-att-href="event._google_map_link()" target="_blank">Get the direction</a>
|
||||
</div>
|
||||
<!-- Organizer -->
|
||||
<div t-if="event.organizer_id" class="o_wevent_sidebar_block">
|
||||
<h6 class="o_wevent_sidebar_title">Organizer</h6>
|
||||
<h4 t-field="event.organizer_id"/>
|
||||
<div itemprop="location" t-field="event.organizer_id" t-options="{'widget': 'contact', 'fields': ['phone', 'mobile', 'email']}"/>
|
||||
</div>
|
||||
<!-- Social -->
|
||||
<div class="o_wevent_sidebar_block">
|
||||
<h6 class="o_wevent_sidebar_title">SHARE</h6>
|
||||
<p class="mb-2">Find out what people see and say about this event, and join the conversation.</p>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<!-- Event -->
|
||||
<template id="layout" name="Event">
|
||||
<t t-call="website.layout">
|
||||
<!-- Options -->
|
||||
<t t-set="opt_events_list_categories" t-value="request.website.viewref('website_event.opt_events_list_categories').active"/>
|
||||
<div id="wrap" class="o_wevent_event js_event">
|
||||
<t t-if="not event.menu_id">
|
||||
<nav class="navbar navbar-light border-top shadow-sm d-print-none">
|
||||
<div class="container align-items-baseline justify-content-start">
|
||||
<a href="/event" class="navbar-brand h4 my-0 mr-0 mr-md-4">
|
||||
<i class="fa fa-long-arrow-left text-primary mr-2"/>
|
||||
<span>All Events</span>
|
||||
</a>
|
||||
<ul class="navbar-nav flex-row ml-md-auto ml-0">
|
||||
<li t-if="opt_events_list_categories" class="nav-item mr-3">
|
||||
<a t-attf-href="/event?type=#{event.event_type_id.id}" t-if="event.event_type_id" class="nav-link">
|
||||
<i class="fa fa-folder-open text-primary mr-2"/><span t-field="event.event_type_id"/>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item mr-3">
|
||||
<a t-if="event.country_id" t-attf-href="/event?country=#{event.country_id.id}" class="nav-link">
|
||||
<i class="fa fa-map-marker text-primary mr-2"/><span t-field="event.country_id"/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="d-flex align-items-centerflex-wrap pl-sm-3 pr-0">
|
||||
<t t-call="website_event.events_search_box">
|
||||
<t t-set="_classes" t-value="'ml-auto'"/>
|
||||
<t t-set="_searches" t-value="searches"/>
|
||||
<t t-set="_placeholder">Search an event ...</t>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<nav class="navbar navbar-light border-top shadow-sm navbar-expand-md">
|
||||
<div class="container align-items-baseline">
|
||||
<a href="#" t-field="event.name" class="navbar-brand h4 my-0 mr-0 mr-md-4"/>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#o_wevent_event_submenu" aria-controls="o_wevent_event_submenu" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div id="o_wevent_event_submenu" class="collapse navbar-collapse">
|
||||
<ul class="navbar-nav w-100" t-att-data-menu_name="editable and 'Event Menu'" t-att-data-content_menu_id="editable and event.menu_id.id">
|
||||
<t t-foreach="event.menu_id.child_id" t-as="submenu">
|
||||
<t t-call="website.submenu">
|
||||
<t t-set="item_class" t-value="'nav-item'"/>
|
||||
<t t-set="link_class" t-value="'nav-link'"/>
|
||||
</t>
|
||||
</t>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</t>
|
||||
<t t-raw="0"/>
|
||||
<t t-set="editor_sub_message">Following content will appear on all events.</t>
|
||||
<div class="oe_structure oe_empty" id="oe_structure_website_event_layout_1" t-att-data-editor-sub-message="editor_sub_message"/>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
+88
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
|
||||
<template id="event_details" name="Event Header">
|
||||
<t t-call="website_event.layout">
|
||||
<div name="event" itemscope="itemscope" itemtype="http://schema.org/Event">
|
||||
@@ -26,6 +27,93 @@
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<!-- Event - Description -->
|
||||
<template id="event_description_full" name="Event Description" track="1">
|
||||
<t t-call="website_event.event_details">
|
||||
<section class="bg-200 mt-n5">
|
||||
<div class="container overflow-hidden">
|
||||
<div class="row no-gutters mt-n4 mb-3">
|
||||
<!-- Description -->
|
||||
<div id="o_wevent_event_main_col" class="col-lg-8 bg-white px-3 pt-5 pb-0 shadow-sm">
|
||||
<span t-field="event.description" itemprop="description"/>
|
||||
</div>
|
||||
<div class="col-lg-4 bg-light shadow-sm d-print-none">
|
||||
<!-- Date & Time -->
|
||||
<div class="o_wevent_sidebar_block">
|
||||
<h6 class="o_wevent_sidebar_title">Date & Time</h6>
|
||||
<div class="d-flex">
|
||||
<h5 t-field="event.with_context(tz=event.date_tz).date_begin" class="my-1 mr-1" t-options="{'date_only': 'true', 'format': 'EEEE'}"/>
|
||||
<h5 class="my-1" t-field="event.with_context(tz=event.date_tz).date_begin" t-options="{'date_only': 'true', 'format': 'long'}" itemprop="startDate" t-att-datetime="event.date_begin"/>
|
||||
</div>
|
||||
<t t-if="not event.is_one_day">Start -</t>
|
||||
<span t-field="event.with_context(tz=event.date_tz).date_begin" t-options="{'time_only': 'true', 'format': 'short'}"/>
|
||||
<t t-if="event.is_one_day">
|
||||
<i class="fa fa-long-arrow-right mx-1"/>
|
||||
<span t-field="event.with_context(tz=event.date_tz).date_end" t-options="{'time_only': 'true', 'format': 'short'}"/>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<i class="fa fa-long-arrow-down d-block text-muted mx-3 my-2" style="font-size: 1.5rem"/>
|
||||
<div class="d-flex">
|
||||
<h5 t-field="event.with_context(tz=event.date_tz).date_end" class="my-1 mr-1" t-options="{'date_only': 'true', 'format': 'EEEE'}"/>
|
||||
<h5 class="my-1" t-field="event.with_context(tz=event.date_tz).date_end" t-options="{'date_only': 'true', 'format': 'long'}"/>
|
||||
</div>
|
||||
<t t-if="not event.is_one_day">End -</t>
|
||||
<span t-field="event.with_context(tz=event.date_tz).date_end" t-options="{'time_only': 'true', 'format': 'short'}"/>
|
||||
</t>
|
||||
<!-- Timezone -->
|
||||
<small t-esc="event.date_tz" class="d-block my-3 text-muted"/>
|
||||
|
||||
<div class="dropdown">
|
||||
<i class="fa fa-calendar mr-1"/>
|
||||
<a href="#" role="button" data-toggle="dropdown">Add to Calendar</a>
|
||||
<div class="dropdown-menu">
|
||||
<a t-att-href="iCal_url" class="dropdown-item">iCal/Outlook</a>
|
||||
<a t-att-href="google_url" class="dropdown-item" target="_blank">Google</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Location -->
|
||||
<div t-if="event.address_id" class="o_wevent_sidebar_block">
|
||||
<h6 class="o_wevent_sidebar_title">Location</h6>
|
||||
<h4 t-field="event.address_id" class="" t-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["name"]
|
||||
}'/>
|
||||
<div itemprop="location" class="mb-2" t-field="event.address_id" t-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["address"],
|
||||
"no_marker": True
|
||||
}'/>
|
||||
<div class="mb-3" t-field="event.address_id" t-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["phone", "mobile", "email"]
|
||||
}'/>
|
||||
<i class="fa fa-map-marker fa-fw" role="img"/>
|
||||
<a t-att-href="event._google_map_link()" target="_blank">Get the direction</a>
|
||||
</div>
|
||||
<!-- Organizer -->
|
||||
<div t-if="event.organizer_id" class="o_wevent_sidebar_block">
|
||||
<h6 class="o_wevent_sidebar_title">Organizer</h6>
|
||||
<h4 t-field="event.organizer_id"/>
|
||||
<div itemprop="location" t-field="event.organizer_id" t-options="{'widget': 'contact', 'fields': ['phone', 'mobile', 'email']}"/>
|
||||
</div>
|
||||
<!-- Social -->
|
||||
<div class="o_wevent_sidebar_block">
|
||||
<h6 class="o_wevent_sidebar_title">SHARE</h6>
|
||||
<p class="mb-2">Find out what people see and say about this event, and join the conversation.</p>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<!-- Event - Registration -->
|
||||
<template id="registration_template" name="Registration">
|
||||
<div t-if="request.env.user.has_group('event.group_event_manager')" class="alert alert-info rounded-0 o_website_event_configuration o_not_editable" role="status">
|
||||
@@ -0,0 +1,55 @@
|
||||
<?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) > 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>
|
||||
|
||||
</odoo>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="event_type_view_form_inherit_website" model="ir.ui.view">
|
||||
<field name="name">event.type.view.form.inherit.website</field>
|
||||
<field name="model">event.type</field>
|
||||
<field name="inherit_id" ref="event.view_event_type_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<div name="event_type_visibility_seats" position="after">
|
||||
<div class="col-12 col-lg-6 o_setting_box" name="event_type_visibility_website">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="website_menu"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="website_menu"/>
|
||||
<div class="row" name="website_menu">
|
||||
<div class="col-lg-8 mt16 text-muted">
|
||||
Check this option to have menus for your event on the
|
||||
website: registrations, schedule, map, ...
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user