summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Beguin <dbe@odoo.com>2020-02-11 15:32:53 +0000
committerDavid Beguin <dbe@odoo.com>2020-02-13 15:29:00 +0000
commitf9d34ec7114b42978dbccb7341d263e3d97e4907 (patch)
tree44397fb30c9349c935018faffd2a549014d0017c
parent732cb7c254508a25e78c0f544e4057d4c059c3d5 (diff)
[IMP] survey, website_livechat: hide livechat in survey layout
Purpose ======= Lighten the survey layout. Livechat button should not appear on survey pages. Specifications ============== Survey Layout inherits from web.frontend_layout, mainly to be able to use all the styles rules defined in it and keep consistency between other frontend pages and survey. To avoid having the livechat button displayed on survey layout, 'no_livechat' template variable has been introduced. The livechat button will be displayed on all layout inheriting from frontend_layout (that is extended in website_livechat to add that livechat button) only if 'no_livechat' is False. By default, this variable is not set so will be considered as False. In survey layout, no_livechat is set to True. Links ===== Task ID: 2195185 PR #45112
-rw-r--r--addons/survey/views/survey_templates.xml4
-rw-r--r--addons/website_livechat/views/website_livechat.xml2
2 files changed, 5 insertions, 1 deletions
diff --git a/addons/survey/views/survey_templates.xml b/addons/survey/views/survey_templates.xml
index 268aad6c9d2..7c7815b354c 100644
--- a/addons/survey/views/survey_templates.xml
+++ b/addons/survey/views/survey_templates.xml
@@ -3,6 +3,10 @@
<data>
<!-- Main survey layout -->
<template id="survey.layout" name="Survey Layout" inherit_id="web.frontend_layout" primary="True">
+ <xpath expr="//div[@id='wrapwrap']" position="before">
+ <!--TODO DBE Fix me : If one day, there is a survey_livechat bridge module, put this in that module-->
+ <t t-set="no_livechat" t-value="True"/>
+ </xpath>
<xpath expr="//div[@id='wrapwrap']" position="attributes">
<attribute name="t-att-style" add="('height: 100%; overflow: auto; background: url(' + '/survey/get_background_image/%s/%s' % (survey.access_token, answer.access_token) + ') no-repeat fixed center; box-shadow: inset 0 0 0 10000px rgba(255,255,255,.7); background-size: cover;') if survey and survey.background_image and answer else 'height: 100%; overflow: auto;'"/>
</xpath>
diff --git a/addons/website_livechat/views/website_livechat.xml b/addons/website_livechat/views/website_livechat.xml
index 20c5c08c861..28860638f79 100644
--- a/addons/website_livechat/views/website_livechat.xml
+++ b/addons/website_livechat/views/website_livechat.xml
@@ -53,7 +53,7 @@
<template id="loader" inherit_id="website.layout" name="Livechat : include loader on Website">
<xpath expr="//div[@id='wrapwrap']" position="after">
- <t t-if="website and website.channel_id">
+ <t t-if="website and website.channel_id and not no_livechat">
<script>
<t t-call="im_livechat.loader">
<t t-set="info" t-value="website.get_livechat_channel_info()"/>