[IMP] website, *: add 'slogan' header template

*: website_sale, website_sale_wishlist

Part of https://github.com/odoo/odoo/pull/56427
task-2264627

X-original-commit: 706769cbccc9f53e89c3f4a5308fa0a6f07dce2a
Co-authored-by: qsm-odoo <qsm@odoo.com>
This commit is contained in:
Cocographique
2020-08-28 08:19:40 +00:00
committed by Xavier-Do
co-authored by qsm-odoo
parent 9975b51379
commit 40de8261a5
5 changed files with 117 additions and 0 deletions
+1
View File
@@ -187,6 +187,7 @@ class Theme(models.AbstractModel):
self.disable_view('website.template_header_hamburger')
self.disable_view('website.template_header_vertical')
self.disable_view('website.template_header_sidebar')
self.disable_view('website.template_header_slogan')
# Reinitialize footer templates
self.enable_view('website.footer_custom')
@@ -580,6 +580,9 @@
<we-button data-name="header_sidebar_opt"
data-customize-website-views="website.template_header_sidebar, website.no_autohide_menu"
data-customize-website-variable="'sidebar'">Sidebar</we-button>
<we-button data-name="header_slogan_opt"
data-customize-website-views="website.template_header_slogan"
data-customize-website-variable="'slogan'">Slogan</we-button>
</we-select>
<!-- Header Sidebar Template - Options -->
@@ -602,6 +602,99 @@
</xpath>
</template>
<template id="template_header_slogan" inherit_id="website.layout" name="Template Header Slogan" active="False">
<xpath expr="//header//nav" position="replace">
<nav class="navbar navbar-expand-lg navbar-light o_colored_level o_cc shadow-sm">
<div id="top_menu_container" class="container flex-row flex-wrap">
<!-- Brand -->
<t t-call="website.placeholder_header_brand">
<t t-set="_link_class" t-value="'mr-4'"/>
</t>
<!-- Slogan -->
<div class="ml-3 mr-auto">
<div class="oe_structure" id="oe_structure_header_slogan_1"/>
</div>
<ul class="nav navbar-nav navbar-expand ml-auto order-last order-lg-0">
<!-- Sign In -->
<t t-call="portal.placeholder_user_sign_in">
<t t-set="_item_class" t-value="'nav-item ml-3'"/>
<t t-set="_link_class" t-value="'btn btn-outline-primary'"/>
</t>
<!-- User Dropdown -->
<t t-call="portal.user_dropdown">
<t t-set="_user_name" t-value="True"/>
<t t-set="_user_name_class" t-value="'font-weight-bold'"/>
<t t-set="_item_class" t-value="'nav-item dropdown ml-3'"/>
<t t-set="_link_class" t-value="'nav-link'"/>
<t t-set="_dropdown_menu_class" t-value="'dropdown-menu-right'"/>
</t>
<!-- Button -->
<li class="nav-item">
<div class="oe_structure" id="oe_structure_header_slogan_2"/>
</li>
</ul>
<!-- Separator -->
<div class="w-100">
<div class="oe_structure" id="oe_structure_header_slogan_3"/>
</div>
<!-- Navbar Toggler -->
<t t-call="website.navbar_toggler"/>
<!-- Navbar Collapse -->
<div id="top_menu_collapse" class="collapse navbar-collapse">
<t t-call="website.navbar_nav">
<t t-set="_nav_class" t-value="'flex-grow-1'"/>
<!-- Menu -->
<t t-foreach="website.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>
</t>
</div>
</div>
</nav>
</xpath>
</template>
<template id="template_header_slogan_oe_structure_header_slogan_1" inherit_id="website.template_header_slogan" name="Template Header Slogan (oe_structure_header_slogan_1)">
<xpath expr="//*[hasclass('oe_structure')][@id='oe_structure_header_slogan_1']" position="replace">
<div class="oe_structure" id="oe_structure_header_slogan_1">
<section class="s_text_block" data-snippet="s_text_block" data-name="Text">
<div class="container">
<h5 class="m-0" data-name="Slogan"><b>Slogan</b> for your Website</h5>
</div>
</section>
</div>
</xpath>
</template>
<template id="template_header_slogan_oe_structure_header_slogan_2" inherit_id="website.template_header_slogan" name="Template Header Slogan (oe_structure_header_slogan_2)">
<xpath expr="//*[hasclass('oe_structure')][@id='oe_structure_header_slogan_2']" position="replace">
<div class="oe_structure" id="oe_structure_header_slogan_2">
<section class="s_text_block" data-snippet="s_text_block" data-name="Text">
<div class="container">
<a href="#" class="btn btn-primary ml-4">Button</a>
</div>
</section>
</div>
</xpath>
</template>
<template id="template_header_slogan_oe_structure_header_slogan_3" inherit_id="website.template_header_slogan" name="Template Header Slogan (oe_structure_header_slogan_3)">
<xpath expr="//*[hasclass('oe_structure')][@id='oe_structure_header_slogan_3']" position="replace">
<div class="oe_structure" id="oe_structure_header_slogan_3">
<section class="s_text_block" data-snippet="s_text_block" data-name="Text">
<div class="container">
<div class="s_hr w-100 pt8 pb8" data-name="Separator">
<hr class="w-100 mx-auto" style="border-top-width: 1px; border-top-style: solid; border-color: var(--200);"/>
</div>
</div>
</section>
</div>
</xpath>
</template>
<!-- Navbar Hamburger Options -->
<template id="option_header_off_canvas" inherit_id="website.navbar_nav" name="Off-Canvas Header" active="False">
<xpath expr="//ul[@id='top_menu']" position="attributes">
+10
View File
@@ -133,6 +133,16 @@
</xpath>
</template>
<template id="template_header_slogan" inherit_id="website.template_header_slogan">
<xpath expr="//t[@t-foreach='website.menu_id.child_id']" position="after">
<t t-call="website_sale.header_cart_link">
<t t-set="_icon" t-value="True"/>
<t t-set="_item_class" t-value="'nav-item ml-lg-auto'"/>
<t t-set="_link_class" t-value="'nav-link'"/>
</t>
</xpath>
</template>
<!-- Products Search Bar input-group template -->
<template id="website_sale_products_search_box" inherit_id="website.website_search_box" primary="True">
<xpath expr="//input[@name='search']" position="attributes">
@@ -92,6 +92,16 @@
</xpath>
</template>
<template id="template_header_slogan" inherit_id="website_sale.template_header_slogan">
<xpath expr="//t[@t-call='website_sale.header_cart_link']" position="after">
<t t-call="website_sale_wishlist.header_wishlist_link">
<t t-set="_icon" t-value="True"/>
<t t-set="_item_class" t-value="'nav-item ml-3'"/>
<t t-set="_link_class" t-value="'nav-link'"/>
</t>
</xpath>
</template>
<template id="product_wishlist" name="Wishlist Page">
<t t-call="website.layout">
<t t-set="additional_title">Shop Wishlist</t>