summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorOdoo's Mergebot <xmo+roboto@odoo.com>2020-02-20 16:12:24 +0100
committerGitHub <noreply@github.com>2020-02-20 16:12:24 +0100
commit85f6290b68fdb01ed42b69e191b8aeb3689397b8 (patch)
tree44397fb30c9349c935018faffd2a549014d0017c /addons
parentbdef3505bd7ab27ace8599f5beecaa2dcd189241 (diff)
parentf9d34ec7114b42978dbccb7341d263e3d97e4907 (diff)
[IMP] survey, website_livechat: remove header, footer and livechat button from survey layout
Purpose ======= Lighten the survey layout. It should be free of website footer and header. Also, 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. Instead of inheriting another layout, this PR sets no_footer and no_header to True for all survey layout. The idea is to show only the survey itself without having other web/website object in the layout. Also, 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 closes odoo/odoo#45112 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/survey/static/src/scss/survey_form.scss16
-rw-r--r--addons/survey/views/survey_templates.xml10
-rw-r--r--addons/survey/views/survey_templates_management.xml2
-rw-r--r--addons/website_livechat/views/website_livechat.xml2
4 files changed, 22 insertions, 8 deletions
diff --git a/addons/survey/static/src/scss/survey_form.scss b/addons/survey/static/src/scss/survey_form.scss
index f9f98c9ea03..ef026c664d2 100644
--- a/addons/survey/static/src/scss/survey_form.scss
+++ b/addons/survey/static/src/scss/survey_form.scss
@@ -1,10 +1,22 @@
-.o_survey_wrap {
- min-height: 100%;
+/**********************************************************
+ Remove website navbar : Should be done in website survey
+ but we won't do a bridge module only for this.
+ TODO: SmartPeople Fixme - cleaner solution? be my guest!
+ **********************************************************/
+body.o_connected_user {
+ padding-top: 0px !important;
+}
+
+nav#oe_main_menu_navbar {
+ display: none;
}
/**********************************************************
Common Style
**********************************************************/
+.o_survey_wrap {
+ min-height: 100%;
+}
.o_survey_form, .o_survey_print, .o_survey_session_manage, .o_survey_quick_access {
.o_survey_question_error {
diff --git a/addons/survey/views/survey_templates.xml b/addons/survey/views/survey_templates.xml
index 4458946bd9d..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>
@@ -10,14 +14,14 @@
<t t-call-assets="survey.survey_assets" lazy_load="True"/>
</xpath>
<xpath expr="//header" position="before">
- <t t-set="no_header" t-value="no_header or (survey and survey.certification) or (answer and answer.is_session_answer)"/>
- <t t-set="no_footer" t-value="no_footer or not survey or survey.certification or (answer and answer.is_session_answer)"/>
+ <t t-set="no_header" t-value="True"/>
+ <t t-set="no_footer" t-value="True"/>
</xpath>
<xpath expr="//header" position="after">
<div id="wrap" class="oe_structure oe_empty"/>
</xpath>
<xpath expr="//footer" position="after">
- <div t-if="no_footer" class="py-3">
+ <div class="py-3">
<div class="float-right px-5 py-2 bg-white rounded-left">
<t t-call="web.brand_promotion_message">
<t t-set="_message"></t>
diff --git a/addons/survey/views/survey_templates_management.xml b/addons/survey/views/survey_templates_management.xml
index ba26f785fe6..c8af8b020af 100644
--- a/addons/survey/views/survey_templates_management.xml
+++ b/addons/survey/views/survey_templates_management.xml
@@ -105,8 +105,6 @@
Mainly used in 'session mode' to give an easy access to the survey through the '/s' route. -->
<template id="survey_access_code" name="Survey: Access Code page">
<t t-call="survey.layout">
- <t t-set="no_header" t-value="True" />
- <t t-set="no_footer" t-value="True" />
<div class="wrap o_survey_wrap pb16 d-flex">
<div class="container o_survey_quick_access d-flex flex-column">
<div class="d-flex flex-grow-1 align-items-center">
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()"/>