[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>
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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()"/>
|
||||
|
||||
Reference in New Issue
Block a user