diff --git a/addons/portal/views/portal_templates.xml b/addons/portal/views/portal_templates.xml index 72d8516c2be..f50045d0e88 100644 --- a/addons/portal/views/portal_templates.xml +++ b/addons/portal/views/portal_templates.xml @@ -6,28 +6,23 @@ - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/addons/test_website/static/tests/tours/reset_views.js b/addons/test_website/static/tests/tours/reset_views.js index 0c7aa9517ad..0a7ce49e4c4 100644 --- a/addons/test_website/static/tests/tours/reset_views.js +++ b/addons/test_website/static/tests/tours/reset_views.js @@ -87,7 +87,7 @@ tour.register('test_reset_page_view_complete_flow_part2', { content: "select oe_structure view", trigger: '#s2id_ace-view-list', // use select2 version run: function () { - var viewId = $('#ace-view-list option:contains("oe_structure")').val(); + var viewId = $('#ace-view-list option:contains("oe_structure_test_website_page")').val(); $('#ace-view-list').val(viewId).trigger('change'); }, }, diff --git a/addons/website/models/theme_models.py b/addons/website/models/theme_models.py index 3248b837519..ec0baef02ff 100644 --- a/addons/website/models/theme_models.py +++ b/addons/website/models/theme_models.py @@ -183,9 +183,9 @@ class Theme(models.AbstractModel): self.disable_view('website.option_ripple_effect') # Reinitialize header templates + self.enable_view('website.template_header_default') self.disable_view('website.template_header_hamburger') self.disable_view('website.template_header_vertical') - self.disable_view('website.option_header_hamburger_center_logo') # Reinitialize footer templates self.enable_view('website.footer_custom') diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index b94b0310e35..68efd1500e4 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -1767,14 +1767,6 @@ options.registry.collapse = options.Class.extend({ }); options.registry.Header = options.Class.extend({ - /** - * @override - */ - async updateUI() { - await this._super(...arguments); - const isHamburger = this.$('.navbar-toggler').is(':visible'); - this.$el.find('#hamburger_opt_label').toggleClass('d-none', isHamburger); - }, //-------------------------------------------------------------------------- // Private @@ -1793,6 +1785,28 @@ options.registry.Header = options.Class.extend({ } return this._super(...arguments); }, + /** + * @override + */ + async _renderOriginalXML($xml) { + const uiFragment = await this._super(...arguments); + + const widgets = this._requestUserValueWidgets('header_alignment_opt', 'header_hamburger_type_opt'); + for (const widget of widgets) { + const titleEl = widget.el.querySelector('we-title'); + const spanEl1 = document.createElement('span'); + spanEl1.textContent = " (+ "; + titleEl.appendChild(spanEl1); + const iconEl = document.createElement('i'); + iconEl.classList.add('fa', 'fa-mobile'); + titleEl.appendChild(iconEl); + const spanEl2 = document.createElement('span'); + spanEl2.textContent = ")"; + titleEl.appendChild(spanEl2); + } + + return uiFragment; + }, }); const VisibilityPageOptionUpdate = options.Class.extend({ diff --git a/addons/website/static/src/scss/primary_variables.scss b/addons/website/static/src/scss/primary_variables.scss index 4bbe05ecbf4..f0463e8cc26 100644 --- a/addons/website/static/src/scss/primary_variables.scss +++ b/addons/website/static/src/scss/primary_variables.scss @@ -265,7 +265,7 @@ $o-base-website-values-palette: ( 'header-links-style': 'default', // 'default' / 'fill' / 'outline' / 'pills' / 'block' / 'border-bottom' 'logo-height': null, // Default to navbar height (see portal) 'hamburger-type': 'default', // 'default' / 'off-canvas' - 'hamburger-position': 'right', // 'right' / 'left' / 'center' + 'hamburger-position': 'left', // 'left' / 'center' / 'right' 'footer-template': 'default', 'footer-effect': null, // null / 'slideout_slide_hover' / 'slideout_shadow' diff --git a/addons/website/static/src/scss/website.scss b/addons/website/static/src/scss/website.scss index 47a1c249963..90a090df4f6 100644 --- a/addons/website/static/src/scss/website.scss +++ b/addons/website/static/src/scss/website.scss @@ -700,13 +700,16 @@ $-transition-duration: 200ms; } } @if o-website-value('header-template') == 'vertical' { - @include media-breakpoint-up(md) { + .o_header_centered_logo { + display: none; + } + @include media-breakpoint-up(lg) { .navbar-brand { - font-size: 0px; + font-size: 0; opacity: 0; img { - height: 0px; + height: 0; } } } @@ -779,34 +782,20 @@ header { &:not(.o_header_is_scrolled) { $-is-hamburger: o-website-value('header-template') == 'hamburger'; - $-is-vertical: o-website-value('header-template') == 'vertical'; @include media-breakpoint-up(md) { - @if $-is-hamburger or $-is-vertical { + @if $-is-hamburger { #top_menu_container { padding-top: $spacer * 0.5; padding-bottom: $spacer * 0.5; } } - @if $-is-vertical { - .navbar-brand { - margin-bottom: $spacer; - } - } } } - .navbar { - flex-direction: if($-hamburger-left, row-reverse, row); - } #top_menu_container { flex-direction: inherit; } - @if $-hamburger-right { - .navbar-brand { - margin-right: 0; - margin-left: $navbar-padding-x; - } - } @else if $-hamburger-center { + @if $-hamburger-center { .collapsing, .show { #top_menu { @if not $-off-canvas-hamburger { @@ -848,6 +837,7 @@ header { } #top_menu { + flex: 0 0 auto !important; overflow: auto; flex-wrap: nowrap; @if $-hamburger-center { @@ -856,6 +846,8 @@ header { } @else { max-width: 560px; } + min-width: 250px; + margin: 0 !important; background-color: o-color('menu'); transition: transform $-transition-duration cubic-bezier(.694, .0482, .335, 1); @@ -903,11 +895,11 @@ header { } } &.collapsing #top_menu { - @if o-website-value('hamburger-position') == 'center' { + @if $-hamburger-center { transform: translateY(-100%); - } @else if o-website-value('hamburger-position') == 'left' { + } @else if $-hamburger-left { transform: translateX(-100%); - } @else if o-website-value('hamburger-position') == 'right' { + } @else if $-hamburger-right { transform: translateX(100%); } } @@ -925,6 +917,20 @@ header { } } +@if o-website-value('header-template') == 'vertical' { + header .o_header_centered_logo { + order: -1; + width: 50%; + margin-top: $spacer; + + @include media-breakpoint-up(lg) { + order: inherit; + width: 40%; + margin-bottom: $spacer; + } + } +} + // Mega menu .o_mega_menu { width: 100%; diff --git a/addons/website/static/tests/tours/html_editor.js b/addons/website/static/tests/tours/html_editor.js index 22742df39e1..e22ded23311 100644 --- a/addons/website/static/tests/tours/html_editor.js +++ b/addons/website/static/tests/tours/html_editor.js @@ -46,7 +46,7 @@ tour.register('html_editor_multiple_templates', { content: "select oe_structure specific view", trigger: 'div.ace_line .ace_xml:contains("somenewcontent")', run: function () { - var viewId = $('#ace-view-list option:contains("oe_structure")').val(); + var viewId = $('#ace-view-list option:contains("oe_structure_test_ui")').val(); $('#ace-view-list').val(viewId).trigger('change'); }, }, diff --git a/addons/website/views/snippets/snippets.xml b/addons/website/views/snippets/snippets.xml index 96a3efa0f04..e63bc6807a1 100644 --- a/addons/website/views/snippets/snippets.xml +++ b/addons/website/views/snippets/snippets.xml @@ -563,8 +563,8 @@ - Hamburger (Mobile) - + + + + + Left + Center + Right + + + + Default Off-Canvas + data-customize-website-views="website.option_header_off_canvas, website.option_header_off_canvas_template_header_hamburger">Off-Canvas - - Right - Left - Center / Full - - + Text Image - Header - - - - - - - - - - - - - - - - - - - - - Footer @@ -225,41 +204,340 @@ + + + + + + + + + + + + + + - - - - - - $0 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Button + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Button + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Follow us + + + + + + + + + + + + + + + + + info@yourcompany.example.com + + + 1 (650) 691-3277 + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Follow us + + + + + + + + + + + + + + + + + + + + + + + + + 1 (650) 691-3277 + + + + + + + + + + + + + + + + + - - + + - + - + × - + My Website @@ -267,13 +545,18 @@ - + + + + + + @@ -281,12 +564,6 @@ - - - - - - @@ -335,9 +612,9 @@ - - - + + + diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index 2ed5c9a5c23..e65a271950c 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -73,17 +73,6 @@ - - - - - - - - - - - @@ -103,6 +92,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/website_sale_wishlist/views/website_sale_wishlist_template.xml b/addons/website_sale_wishlist/views/website_sale_wishlist_template.xml index f7ccb131172..c4b97e8edd4 100644 --- a/addons/website_sale_wishlist/views/website_sale_wishlist_template.xml +++ b/addons/website_sale_wishlist/views/website_sale_wishlist_template.xml @@ -30,17 +30,6 @@ - - - - - - - - - - - @@ -62,6 +51,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Shop Wishlist