diff --git a/addons/website/__manifest__.py b/addons/website/__manifest__.py index 6c911e67330..2288e6296d7 100644 --- a/addons/website/__manifest__.py +++ b/addons/website/__manifest__.py @@ -273,6 +273,8 @@ 'website/static/src/components/editor/editor.scss', 'website/static/src/components/editor/editor.xml', 'website/static/src/components/navbar/navbar.js', + 'website/static/src/components/navbar/navbar.scss', + 'website/static/src/components/navbar/navbar.xml', 'website/static/src/components/burger_menu/burger_menu.js', 'website/static/src/components/switch/switch.js', 'website/static/src/components/switch/switch.scss', diff --git a/addons/website/static/src/components/navbar/navbar.js b/addons/website/static/src/components/navbar/navbar.js index d4f198c8c64..8d373a0c010 100644 --- a/addons/website/static/src/components/navbar/navbar.js +++ b/addons/website/static/src/components/navbar/navbar.js @@ -44,11 +44,18 @@ patch(NavBar.prototype, { useBus(websiteSystrayRegistry, 'CONTENT-UPDATED', renderAndAdapt); }, + get shouldDisplayWebsiteSystray() { + return this.websiteService.currentWebsite && this.websiteService.isRestrictedEditor; + }, + + // Somehow a setter is needed in `patch()` to avoid an owl error. + set shouldDisplayWebsiteSystray(_) {}, + /** * @override */ get systrayItems() { - if (this.websiteService.currentWebsite && this.websiteService.isRestrictedEditor) { + if (this.shouldDisplayWebsiteSystray) { return websiteSystrayRegistry .getEntries() .map(([key, value], index) => ({ key, ...value, index })) diff --git a/addons/website/static/src/components/navbar/navbar.scss b/addons/website/static/src/components/navbar/navbar.scss new file mode 100644 index 00000000000..e5a99466791 --- /dev/null +++ b/addons/website/static/src/components/navbar/navbar.scss @@ -0,0 +1,9 @@ +.o_menu_systray.o_website_systray { + @if $o-navbar-use-pills { + --NavBar-entry-margin-left: #{$o-navbar-entry-padding-h * 0.5}; + --NavBar-entry-margin-right: #{$o-navbar-entry-padding-h * 0.5}; + } @else { + --NavBar-entry-padding-left: #{$o-navbar-entry-padding-h}; + --NavBar-entry-padding-right: #{$o-navbar-entry-padding-h}; + } +} diff --git a/addons/website/static/src/components/navbar/navbar.xml b/addons/website/static/src/components/navbar/navbar.xml new file mode 100644 index 00000000000..9a6292a0dbc --- /dev/null +++ b/addons/website/static/src/components/navbar/navbar.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/addons/website/static/src/systray_items/edit_website.scss b/addons/website/static/src/systray_items/edit_website.scss index d82eeabc07f..acc5452260a 100644 --- a/addons/website/static/src/systray_items/edit_website.scss +++ b/addons/website/static/src/systray_items/edit_website.scss @@ -1,3 +1,10 @@ .o_edit_website_container { margin: -$o-navbar-padding-v 0; + + &.o_not_translatable .o_nav_entry { + &, &:hover { + background-color: inherit; + color: inherit; + } + } } diff --git a/addons/website/static/src/systray_items/edit_website.xml b/addons/website/static/src/systray_items/edit_website.xml index 21417080edf..081f7fb7ebb 100644 --- a/addons/website/static/src/systray_items/edit_website.xml +++ b/addons/website/static/src/systray_items/edit_website.xml @@ -1,11 +1,13 @@ -
- - - - + diff --git a/addons/website/static/src/systray_items/mobile_preview.xml b/addons/website/static/src/systray_items/mobile_preview.xml index ada0138cde1..4a41a70ba5f 100644 --- a/addons/website/static/src/systray_items/mobile_preview.xml +++ b/addons/website/static/src/systray_items/mobile_preview.xml @@ -2,9 +2,9 @@ diff --git a/addons/website/static/src/systray_items/new_content.xml b/addons/website/static/src/systray_items/new_content.xml index b03f2883c06..7bc26b9bf06 100644 --- a/addons/website/static/src/systray_items/new_content.xml +++ b/addons/website/static/src/systray_items/new_content.xml @@ -41,7 +41,7 @@
- New + New
diff --git a/addons/website/static/src/systray_items/publish.js b/addons/website/static/src/systray_items/publish.js index 01038609012..8d1f05f5fe0 100644 --- a/addons/website/static/src/systray_items/publish.js +++ b/addons/website/static/src/systray_items/publish.js @@ -58,7 +58,7 @@ PublishSystray.template = xml` `; PublishSystray.components = { diff --git a/addons/website/static/src/systray_items/translate_website.scss b/addons/website/static/src/systray_items/translate_website.scss index 4397f19ce20..8f7f53168e3 100644 --- a/addons/website/static/src/systray_items/translate_website.scss +++ b/addons/website/static/src/systray_items/translate_website.scss @@ -1,3 +1,10 @@ .o_translate_website_container { margin: -$o-navbar-padding-v 0; + + .btn .o_nav_entry { + &, &:hover { + background-color: inherit; + color: inherit; + } + } } diff --git a/addons/website/static/src/systray_items/translate_website.xml b/addons/website/static/src/systray_items/translate_website.xml index 41499849783..f46dd9522ea 100644 --- a/addons/website/static/src/systray_items/translate_website.xml +++ b/addons/website/static/src/systray_items/translate_website.xml @@ -1,12 +1,15 @@ - - + + diff --git a/addons/website/static/src/systray_items/website_switcher.xml b/addons/website/static/src/systray_items/website_switcher.xml index d5cc7c9022a..229deed7ec3 100644 --- a/addons/website/static/src/systray_items/website_switcher.xml +++ b/addons/website/static/src/systray_items/website_switcher.xml @@ -4,7 +4,7 @@
- +
diff --git a/addons/website/static/tests/tours/snippet_table_of_content.js b/addons/website/static/tests/tours/snippet_table_of_content.js index 9587a153ade..0c5c0a2dd03 100644 --- a/addons/website/static/tests/tours/snippet_table_of_content.js +++ b/addons/website/static/tests/tours/snippet_table_of_content.js @@ -68,7 +68,7 @@ wTourUtils.registerWebsitePreviewTour('snippet_table_of_content', { }, { content: "Toggle the mobile view", - trigger: '.o_mobile_preview', + trigger: '.o_mobile_preview > a', }, { content: "Check that we have the good TOC on mobile", diff --git a/addons/website_blog/static/src/js/tours/website_blog.js b/addons/website_blog/static/src/js/tours/website_blog.js index 9c6e109ed34..6619175d1cc 100644 --- a/addons/website_blog/static/src/js/tours/website_blog.js +++ b/addons/website_blog/static/src/js/tours/website_blog.js @@ -75,11 +75,11 @@ }, ...wTourUtils.clickOnSave(), { - trigger: ".o_menu_systray_item.o_mobile_preview", + trigger: ".o_menu_systray_item.o_mobile_preview > a", content: markup(_t("Use this icon to preview your blog post on mobile devices.")), position: "bottom", }, { - trigger: ".o_menu_systray_item.o_mobile_preview", + trigger: ".o_menu_systray_item.o_mobile_preview > a", extra_trigger: '.o_website_preview.o_is_mobile', content: _t("Once you have reviewed the content on mobile, you can switch back to the normal view by clicking here again"), position: "right",