From e5b094b683f77a3c22ab64a6fdb09d976ccc6fbf Mon Sep 17 00:00:00 2001 From: "Arthur Detroux (ard)" Date: Tue, 15 Feb 2022 16:49:58 +0100 Subject: [PATCH] [IMP] website, *: remove unused assets *: website_blog, website_event, website_forum, website_links, website_livechat, website_slides, survey, web_editor This commit removes the website navbar root widget, as the edition is now handled in the backend through the client action and custom menus. It removes associated widgets and their css. See merge commit for more information. task-2687506 --- .../src/scss/survey_templates_form.scss | 4 - .../static/src/scss/web_editor.variables.scss | 210 ---------- addons/website/__manifest__.py | 3 - .../website/static/src/js/menu/customize.js | 228 ----------- .../website/static/src/js/menu/debug_menu.js | 23 -- addons/website/static/src/js/menu/navbar.js | 291 ------------- .../src/scss/website.navbar.mobile.scss | 115 ------ .../static/src/scss/website.navbar.scss | 20 - .../website/static/src/scss/website.ui.scss | 382 ------------------ .../website/static/src/xml/website.editor.xml | 8 - addons/website/static/src/xml/website.xml | 72 ---- .../views/website_navbar_templates.xml | 138 ------- addons/website/views/website_templates.xml | 18 - .../views/website_blog_templates.xml | 10 - addons/website_event/__manifest__.py | 1 - .../static/src/scss/event_templates_page.scss | 6 +- .../website_event/views/website_templates.xml | 22 - addons/website_forum/views/website_forum.xml | 12 - .../views/website_links_template.xml | 10 - .../views/website_livechat.xml | 7 - .../static/src/scss/website_slides.scss | 4 - 21 files changed, 1 insertion(+), 1583 deletions(-) delete mode 100644 addons/website/static/src/js/menu/customize.js delete mode 100644 addons/website/static/src/js/menu/debug_menu.js delete mode 100644 addons/website/static/src/js/menu/navbar.js delete mode 100644 addons/website/static/src/scss/website.navbar.mobile.scss delete mode 100644 addons/website/static/src/scss/website.navbar.scss delete mode 100644 addons/website_event/views/website_templates.xml diff --git a/addons/survey/static/src/scss/survey_templates_form.scss b/addons/survey/static/src/scss/survey_templates_form.scss index 7715a4acff8..3e2c5a976d9 100644 --- a/addons/survey/static/src/scss/survey_templates_form.scss +++ b/addons/survey/static/src/scss/survey_templates_form.scss @@ -4,10 +4,6 @@ only for this. TODO: SmartPeople Fixme - cleaner solution? be my guest! **********************************************************/ -body.o_connected_user { - padding-top: 0px !important; -} - nav.o_frontend_to_backend_nav { display: none !important; } diff --git a/addons/web_editor/static/src/scss/web_editor.variables.scss b/addons/web_editor/static/src/scss/web_editor.variables.scss index 109f008fd9c..2f009dee28f 100644 --- a/addons/web_editor/static/src/scss/web_editor.variables.scss +++ b/addons/web_editor/static/src/scss/web_editor.variables.scss @@ -208,216 +208,6 @@ $o-we-technical-modal-zindex: 2001; box-shadow: 0 0 15px 2px #000; } -//------------------------------------------------------------------------------ -// Mixins to shield UI from themed bootstrap -//------------------------------------------------------------------------------ - -@mixin o-w-preserve-base { - font-size: $o-we-font-size; - font-family: $o-we-font-family; - line-height: 1.5; - color: #33363e; - - .text-muted { - color: #999999 !important; - } -} - -@mixin o-w-preserve-headings { - h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { - font-family: $o-we-font-family; - line-height: 1.5; - color: $o-we-bg-light; - font-weight: bold; - } - h1, .h1 { - font-size: 2.4 * $o-we-font-size; - } - h2, .h2 { - font-size: 1.5 * $o-we-font-size; - } - h3, .h3 { - font-size: 1.3 * $o-we-font-size; - } - h4, .h4 { - font-size: 1.2 * $o-we-font-size; - } - h5, .h5 { - font-size: 1.1 * $o-we-font-size; - } - h6, .h6 { - font-size: $o-we-font-size; - } -} - -@mixin o-w-preserve-links { - a:not(.o_btn_preview) { - color: $o-brand-primary; - - &:focus, &:active, &:focus:active { - outline: none!important; - } - } - - .badge { - &:hover a, a { - color: #fff; - } - } -} - -@mixin o-w-preserve-forms { - :not(.input-group):not(.form-group):not(.input-group-append):not(.input-group-prepend) > .form-control { - height: 34px; - } - .form-control { - padding: 6px 12px; - font-size: 14px; - line-height: 1.5; - border: 1px solid #d4d5d7; - color: #555; - background-color: #fff; - border-radius: 0; - - &.is-invalid { - border-color: $danger; - } - } - .input-group .form-control { - height: auto; - } - .input-group-text { - background-color: #e9ecef; - } - - .was-validated { - .form-control:invalid { - border-color: $danger; - } - } - - select.form-control { - appearance: none; - background: url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPScxLjEnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZycgeG1 sbnM6eGxpbms9J2h0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsnIHdpZHRoPScyNCcgaGVpZ2 h0PScyNCcgdmlld0JveD0nMCAwIDI0IDI0Jz48cGF0aCBpZD0nc3ZnXzEnIGQ9J203LjQwNiw3L jgyOGw0LjU5NCw0LjU5NGw0LjU5NCwtNC41OTRsMC40MDYsMS40MDZsLTUsNC43NjZsLTUsLTQu NzY2bDAuNDA2LC0xLjQwNnonIGZpbGw9JyM4ODgnLz48L3N2Zz4='); - background-position: 100% 65%; - background-repeat: no-repeat; - } -} - -@mixin o-w-preserve-modals { - .modal-content { - border-radius: 0; - background-color: white; - - .modal-header { - border-bottom-color: #e9ecef; - } - .modal-body { - background-color: white; - } - .modal-footer { - border-top-color: #e9ecef; - text-align: left; - } - } - - .close { - font-size: 1.5 * $o-we-font-size; - } -} - -@mixin o-w-preserve-tabs { - .nav-tabs { - border-bottom: 1px solid #e9ecef; - - > li { - > a { - line-height: 1.5; - color: #4e525b; - - &:hover { - border-color: #dee2e6; - } - - &.active { - &, &:hover, &:focus { - color: #3D4047; - background-color: white; - border-color: #dee2e6 #dee2e6 #FFFFFF; - } - } - } - } - } -} - -@mixin o-w-preserve-btn { - .btn:not(.o_btn_preview) { - border-radius: 0; - font-weight: normal; - text-transform: none; - @include button-size(.375rem, .75rem, 0.875rem, 1.5, 0); - - &.btn-primary { - @include button-variant($o-brand-primary, $o-brand-primary); - color: white; - } - &.btn-secondary { - @include button-variant(white, white); - color: $o-brand-primary; - } - &.btn-link { - @include button-variant(white, white); - color: $o-brand-primary; - } - &.btn-success { - @include button-variant($o-we-color-success, $o-we-color-success); - color: white; - } - &.btn-info { - @include button-variant($o-we-color-info, $o-we-color-info); - color: white; - } - &.btn-warning { - @include button-variant($o-we-color-warning, $o-we-color-warning); - color: #33363e; - } - &.btn-danger { - @include button-variant($o-we-color-danger, $o-we-color-danger); - color: #33363e; - } - } -} - -@mixin o-w-preserve-cards { - .card { - padding: 19px; - margin-bottom: 20px; - background-color: white; - border: 1px solid darken(white, 5%); - border-radius: 0; - box-shadow: none; - } -} - -@mixin o-w-preserve-dropdown-menus { - .dropdown-menu { - background-color: white; - } - .dropdown-item { - color: #212529; - - @include hover-focus { - color: darken(#212529, 5%); - } - &.active, - &:active { - color: white; - @include gradient-bg($o-brand-primary); - } - } -} - // ------------------------------------------------------------------ // Selection wrapper // ------------------------------------------------------------------ diff --git a/addons/website/__manifest__.py b/addons/website/__manifest__.py index c0573389891..e97c47929e9 100644 --- a/addons/website/__manifest__.py +++ b/addons/website/__manifest__.py @@ -120,15 +120,12 @@ ('replace', 'web/static/src/legacy/js/public/public_root_instance.js', 'website/static/src/js/content/website_root_instance.js'), 'website/static/src/scss/website.scss', 'website/static/src/scss/website.ui.scss', - 'website/static/src/scss/website.navbar.scss', - 'website/static/src/scss/website.navbar.mobile.scss', 'website/static/src/js/utils.js', 'website/static/src/js/content/website_root.js', 'website/static/src/js/widgets/dialog.js', 'website/static/src/js/content/compatibility.js', 'website/static/src/js/content/menu.js', 'website/static/src/js/content/snippets.animation.js', - 'website/static/src/js/menu/navbar.js', 'website/static/src/js/show_password.js', 'website/static/src/js/post_link.js', 'website/static/src/js/plausible.js', diff --git a/addons/website/static/src/js/menu/customize.js b/addons/website/static/src/js/menu/customize.js deleted file mode 100644 index f2d8e923fdf..00000000000 --- a/addons/website/static/src/js/menu/customize.js +++ /dev/null @@ -1,228 +0,0 @@ -odoo.define('website.customizeMenu', function (require) { -'use strict'; - -var core = require('web.core'); -var Widget = require('web.Widget'); -var websiteNavbarData = require('website.navbar'); -var WebsiteAceEditor = require('website.ace'); - -const { registry } = require("@web/core/registry"); - -var qweb = core.qweb; - -var CustomizeMenu = Widget.extend({ - xmlDependencies: ['/website/static/src/xml/website.editor.xml'], - events: { - 'show.bs.dropdown': '_onDropdownShow', - 'change .dropdown-item[data-view-key]': '_onCustomizeOptionChange', - }, - - /** - * @override - */ - willStart: function () { - this.viewName = $(document.documentElement).data('view-xmlid'); - return this._super.apply(this, arguments); - }, - /** - * @override - */ - start: function () { - if (!this.viewName) { - _.defer(this.destroy.bind(this)); - } - - if (this.$el.is('.show')) { - this._loadCustomizeOptions(); - } - return this._super.apply(this, arguments); - }, - - //-------------------------------------------------------------------------- - // Private - //-------------------------------------------------------------------------- - - /** - * Enables/Disables a view customization whose id is given. - * - * @private - * @param {string} viewKey - * @returns {Promise} - * Unresolved if the customization succeeded as the page will be - * reloaded. - * Rejected otherwise. - */ - _doCustomize: function (viewKey) { - return this._rpc({ - route: '/website/toggle_switchable_view', - params: { - 'view_key': viewKey, - }, - }).then(function () { - window.location.reload(); - return new Promise(function () {}); - }); - }, - /** - * Loads the information about the views which can be enabled/disabled on - * the current page and shows them as switchable elements in the menu. - * - * @private - * @return {Promise} - */ - _loadCustomizeOptions: function () { - if (this.__customizeOptionsLoaded) { - return Promise.resolve(); - } - this.__customizeOptionsLoaded = true; - - var $menu = this.$el.children('.dropdown-menu'); - return this._rpc({ - route: '/website/get_switchable_related_views', - params: { - key: this.viewName, - }, - }).then(function (result) { - var currentGroup = ''; - if (result.length) { - $menu.append($('
', { - class: 'dropdown-divider', - role: 'separator', - })); - } - _.each(result, function (item) { - if (currentGroup !== item.inherit_id[1]) { - currentGroup = item.inherit_id[1]; - $menu.append(''); - } - var $label = $(qweb.render('website.components.switch', {id: 'switch-' + item.id, label: item.name})); - $label.attr("data-view-key", item.key); - $label.find('input').prop('checked', !!item.active); - $menu.append($label); - }); - }); - }, - - //-------------------------------------------------------------------------- - // Handlers - //-------------------------------------------------------------------------- - - /** - * Called when a view's related switchable element is clicked -> enable / - * disable the related view. - * - * @private - * @param {Event} ev - */ - _onCustomizeOptionChange: function (ev) { - ev.preventDefault(); - var viewKey = $(ev.currentTarget).data('viewKey'); - this._doCustomize(viewKey); - }, - /** - * @private - */ - _onDropdownShow: function () { - this._loadCustomizeOptions(); - }, -}); - -var AceEditorMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({ - actions: _.extend({}, websiteNavbarData.WebsiteNavbarActionWidget.prototype.actions || {}, { - close_all_widgets: '_hideEditor', - edit: '_enterEditMode', - ace: '_launchAce', - }), - - /** - * Launches the ace editor automatically when the corresponding hash is in - * the page URL. - * - * @override - */ - start: function () { - if (window.location.hash.substr(0, WebsiteAceEditor.prototype.hash.length) === WebsiteAceEditor.prototype.hash) { - this._launchAce(); - } - return this._super.apply(this, arguments); - }, - - //-------------------------------------------------------------------------- - // Actions - //-------------------------------------------------------------------------- - - /** - * When handling the "edit" website action, the ace editor has to be closed. - * - * @private - */ - _enterEditMode: function () { - this._hideEditor(); - }, - /** - * @private - */ - _hideEditor: function () { - if (this.globalEditor) { - this.globalEditor.do_hide(); - } - }, - /** - * Launches the ace editor to be able to edit the templates and scss files - * which are used by the current page. - * - * @private - * @returns {Promise} - */ - _launchAce: function () { - var self = this; - var prom = new Promise(function (resolve, reject) { - self.trigger_up('action_demand', { - actionName: 'close_all_widgets', - onSuccess: resolve, - onFailure: reject, - }); - }); - prom.then(function () { - if (self.globalEditor) { - self.globalEditor.do_show(); - return Promise.resolve(); - } else { - var currentHash = window.location.hash; - var indexOfView = currentHash.indexOf("?res="); - var initialResID = undefined; - if (indexOfView >= 0) { - initialResID = currentHash.substr(indexOfView + ("?res=".length)); - var parsedResID = parseInt(initialResID, 10); - if (parsedResID) { - initialResID = parsedResID; - } - } - - self.globalEditor = new WebsiteAceEditor(self, $(document.documentElement).data('view-xmlid'), { - initialResID: initialResID, - defaultBundlesRestriction: [ - 'web.assets_frontend', - 'web.assets_frontend_minimal', - 'web.assets_frontend_lazy', - ], - }); - return self.globalEditor.appendTo(document.body); - } - }); - - return prom; - }, -}); - -registry.category("website_navbar_widgets").add("CustomizeMenu", { - Widget: CustomizeMenu, - selector: '#customize-menu', -}); -registry.category("website_navbar_widgets").add("AceEditorMenu", { - Widget: AceEditorMenu, - selector: '#html_editor', -}); - -return CustomizeMenu; -}); diff --git a/addons/website/static/src/js/menu/debug_menu.js b/addons/website/static/src/js/menu/debug_menu.js deleted file mode 100644 index 0fa2f95a7e1..00000000000 --- a/addons/website/static/src/js/menu/debug_menu.js +++ /dev/null @@ -1,23 +0,0 @@ -/** @odoo-module */ -import { registry } from "@web/core/registry"; -import { DebugMenuBasic } from "@web/core/debug/debug_menu_basic"; -import { createDebugContext } from "@web/core/debug/debug_context"; - -const { mount } = owl; -const debugMenuService = { - dependencies: ["localization", "orm"], - start(env) { - if (env.debug) { - const systray = document.querySelector('.o_menu_systray'); - if (systray) { - Object.assign(env, createDebugContext(env, {categories: ["default"]})); - mount(DebugMenuBasic, systray, { - position: 'first-child', - env, - templates: window.__OWL_TEMPLATES__, - }); - } - } - } -}; -registry.category("services").add("website_debug_menu", debugMenuService); diff --git a/addons/website/static/src/js/menu/navbar.js b/addons/website/static/src/js/menu/navbar.js deleted file mode 100644 index c03e621d20c..00000000000 --- a/addons/website/static/src/js/menu/navbar.js +++ /dev/null @@ -1,291 +0,0 @@ -/** @odoo-module alias=website.navbar */ - -import core from 'web.core'; -import dom from 'web.dom'; -import publicWidget from 'web.public.widget'; -import concurrency from 'web.concurrency'; -import Widget from 'web.Widget'; -import { initAutoMoreMenu } from '@web/legacy/js/core/menu'; -import { registry } from "@web/core/registry"; - -var WebsiteNavbar = publicWidget.RootWidget.extend({ - xmlDependencies: ['/website/static/src/xml/website.xml'], - events: _.extend({}, publicWidget.RootWidget.prototype.events || {}, { - 'click [data-action]': '_onActionMenuClick', - 'mouseover > ul > li.dropdown:not(.show)': '_onMenuHovered', - 'click .o_mobile_menu_toggle': '_onMobileMenuToggleClick', - 'mouseenter #oe_applications:not(:has(.dropdown-item))': '_onOeApplicationsHovered', - 'show.bs.dropdown #oe_applications:not(:has(.dropdown-item))': '_onOeApplicationsShow', - }), - custom_events: _.extend({}, publicWidget.RootWidget.prototype.custom_events || {}, { - 'action_demand': '_onActionDemand', - 'edit_mode': '_onEditMode', - 'readonly_mode': '_onReadonlyMode', - 'ready_to_save': '_onSave', - }), - - /** - * @constructor - */ - init: function () { - this._super.apply(this, arguments); - var self = this; - var initPromise = new Promise(function (resolve) { - self.resolveInit = resolve; - }); - this._widgetDefs = [initPromise]; - }, - /** - * @override - */ - start: function () { - var self = this; - initAutoMoreMenu(this.el.querySelector('.o_menu_sections'), { - maxWidth: function () { - // The navbar contains different elements in community and - // enterprise, so we check for both of them here only - return self.$el.width() - - (self.$('.o_menu_systray').outerWidth(true) || 0) - - (self.$('#oe_applications').outerWidth(true) || 0) - - (self.$('.o_menu_toggle').outerWidth(true) || 0) - - (self.$('.o_menu_brand').outerWidth(true) || 0); - }, - }); - return this._super.apply(this, arguments).then(function () { - self.resolveInit(); - }); - }, - - //-------------------------------------------------------------------------- - // Private - //-------------------------------------------------------------------------- - - /** - * @override - */ - _attachComponent: function () { - var def = this._super.apply(this, arguments); - this._widgetDefs.push(def); - return def; - }, - /** - * As the WebsiteNavbar instance is designed to be unique, the associated - * registry has been instantiated outside of the class and is simply - * returned here. - * - * @override - */ - _getRegistry: function () { - return registry.category("website_navbar_widgets"); - }, - /** - * Searches for the automatic widget {@see RootWidget} which can handle that - * action. - * - * @private - * @param {string} actionName - * @param {Array} params - * @returns {Promise} - */ - _handleAction: function (actionName, params, _i) { - var self = this; - return this._whenReadyForActions().then(function () { - var defs = []; - _.each(self._widgets, function (w) { - if (!w.handleAction) { - return; - } - - var def = w.handleAction(actionName, params); - if (def !== null) { - defs.push(def); - } - }); - if (!defs.length) { - // Handle the case where all action-capable components are not - // instantiated yet (rare) -> retry some times to eventually abort - if (_i > 50) { - console.warn(_.str.sprintf("Action '%s' was not able to be handled.", actionName)); - return Promise.reject(); - } - return concurrency.delay(100).then(function () { - return self._handleAction(actionName, params, (_i || 0) + 1); - }); - } - return Promise.all(defs).then(function (values) { - if (values.length === 1) { - return values[0]; - } - return values; - }); - }); - }, - /** - * @private - * @returns {Promise} - */ - async _loadAppMenus() { - if (!this._loadAppMenusProm) { - this._loadAppMenusProm = this._rpc({ - model: 'ir.ui.menu', - method: 'load_menus_root', - args: [], - }); - const result = await this._loadAppMenusProm; - const menus = core.qweb.render('website.oe_applications_menu', { - 'menu_data': result, - }); - this.$('#oe_applications .dropdown-menu').html(menus); - } - return this._loadAppMenusProm; - }, - /** - * @private - */ - _whenReadyForActions: function () { - return Promise.all(this._widgetDefs); - }, - - //-------------------------------------------------------------------------- - // Handlers - //-------------------------------------------------------------------------- - - /** - * Called when the backend applications menu is hovered -> fetch the - * available menus and insert it in DOM. - * - * @private - */ - _onOeApplicationsHovered: function () { - this._loadAppMenus(); - }, - /** - * Called when the backend applications menu is opening -> fetch the - * available menus and insert it in DOM. Needed on top of hovering as the - * dropdown could be opened via keyboard (or the user could just already - * be over the dropdown when the JS is fully loaded). - * - * @private - */ - _onOeApplicationsShow: function () { - this._loadAppMenus(); - }, - /** - * Called when an action menu is clicked -> searches for the automatic - * widget {@see RootWidget} which can handle that action. - * - * @private - * @param {Event} ev - */ - _onActionMenuClick: function (ev) { - const restore = dom.addButtonLoadingEffect(ev.currentTarget); - this._handleAction($(ev.currentTarget).data('action')).then(restore).guardedCatch(restore); - }, - /** - * Called when an action is asked to be executed from a child widget -> - * searches for the automatic widget {@see RootWidget} which can handle - * that action. - */ - _onActionDemand: function (ev) { - var def = this._handleAction(ev.data.actionName, ev.data.params); - if (ev.data.onSuccess) { - def.then(ev.data.onSuccess); - } - if (ev.data.onFailure) { - def.guardedCatch(ev.data.onFailure); - } - }, - /** - * Called in response to edit mode activation -> hides the navbar. - * - * @private - */ - _onEditMode: function () { - this.$el.addClass('editing_mode'); - this.do_hide(); - }, - /** - * Called when a submenu is hovered -> automatically opens it if another - * menu was already opened. - * - * @private - * @param {Event} ev - */ - _onMenuHovered: function (ev) { - var $opened = this.$('> ul > li.dropdown.show'); - if ($opened.length) { - $opened.find('.dropdown-toggle').dropdown('toggle'); - $(ev.currentTarget).find('.dropdown-toggle').dropdown('toggle'); - } - }, - /** - * Called when the mobile menu toggle button is click -> modifies the DOM - * to open the mobile menu. - * - * @private - */ - _onMobileMenuToggleClick: function () { - this.$el.parent().toggleClass('o_mobile_menu_opened'); - }, - /** - * Called in response to edit mode activation -> hides the navbar. - * - * @private - */ - _onReadonlyMode: function () { - this.$el.removeClass('editing_mode'); - this.do_show(); - }, - /** - * Called in response to edit mode saving -> checks if action-capable - * children have something to save. - * - * @private - * @param {OdooEvent} ev - */ - _onSave: function (ev) { - ev.data.defs.push(this._handleAction('on_save')); - }, -}); - -var WebsiteNavbarActionWidget = Widget.extend({ - /** - * 'Action name' -> 'Handler name' object - * - * Any [data-action="x"] element inside the website navbar will - * automatically trigger an action "x". This action can then be handled by - * any `WebsiteNavbarActionWidget` instance if the action name "x" is - * registered in this `actions` object. - */ - actions: {}, - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - /** - * Checks if the widget can execute an action whose name is given, with the - * given parameters. If it is the case, execute that action. - * - * @param {string} actionName - * @param {Array} params - * @returns {Promise|null} action's promise or null if no action was found - */ - handleAction: function (actionName, params) { - var action = this[this.actions[actionName]]; - if (action) { - return Promise.resolve(action.apply(this, params || [])); - } - return null; - }, -}); - -registry.category("public_root_widgets").add("WebsiteNavbar", { - Widget: WebsiteNavbar, - selector: '#oe_main_menu_navbar', -}); - -export default { - WebsiteNavbar: WebsiteNavbar, - WebsiteNavbarActionWidget: WebsiteNavbarActionWidget, -}; diff --git a/addons/website/static/src/scss/website.navbar.mobile.scss b/addons/website/static/src/scss/website.navbar.mobile.scss deleted file mode 100644 index aac6863eb8f..00000000000 --- a/addons/website/static/src/scss/website.navbar.mobile.scss +++ /dev/null @@ -1,115 +0,0 @@ -// Achieve a top-menu design visually similar to the backend's 'burger' one. - -// = Mobile Main Navbar -// ============================================================================ -@include media-breakpoint-down(sm) { - #oe_main_menu_navbar.o_main_navbar { - - // = Scoped Variables - // - // Variables scopend within the current context that mirror backend's - // boostrap values. - // -------------------------------------------------------------------- - $-bg: darken($o-brand-odoo, 10%); - $-color: color-yiq($-bg); - $-font-size-base: 16px; - $-font-size-lg: 18px; - $-entry-hover-bg: rgba(invert($-color), .08); - - - // = Invalidate top-menu native 'flex' layout - // -------------------------------------------------------------------- - display: block !important; - - .o_menu_toggle { - display: inline !important; - } - - .o_menu_sections li, .dropdown-menu.show { - display: block; - position: relative; - width: 100%; - height: auto; - } - - // = Design - // -------------------------------------------------------------------- - .o_mobile_menu_toggle, - .dropdown-toggle, - .dropdown-item, - .o_menu_sections > .css_published { - height: $o-navbar-height; - @include o-hover-text-color(rgba($-color, .9), $-color); - } - - .o_menu_sections { - @include o-position-absolute($o-navbar-height, 0, 0, 0); - display: none; - overflow: auto; - background-color: $-bg; - - > li > a { - font-size: $-font-size-lg; - } - - li.css_published:hover { - background-color: $-entry-hover-bg; - } - } - - .dropdown-divider { - border-top-color: rgba($-color, .06); - margin-left: $dropdown-item-padding-x; - margin-right: $dropdown-item-padding-x; - } - - .dropdown.show { - &, .dropdown-toggle, .dropdown-item, .dropdown-menu { - background-color: darken($-bg, 5%); - } - - > .dropdown-toggle { - @include o-hover-text-color($-color, $-color); - outline: 0; - box-shadow: inset 0 1px 0 rgba(invert($-color), .1); - } - - .dropdown-menu { - border: 0; - padding-top: 0; - box-shadow: inset 0 -1px 0 rgba($-color, .1); - } - - .dropdown-item { - display: flex; - align-items: center; - font-size: $-font-size-base; - } - } - - // = Toggle Menu (open) - // -------------------------------------------------------------------- - body.o_mobile_menu_opened > & { - height: 100%; - - .o_menu_sections { - display: block !important; - height: 100%; - width: 100%; - } - - .o_mobile_menu_toggle:before { - content: "\f00d" - } - } - } -} - -@include media-breakpoint-down(sm) { - .o_switch_company_menu > .dropdown-menu { - padding-top: 0px; - .bg-info { - padding: 10px; - } - } -} diff --git a/addons/website/static/src/scss/website.navbar.scss b/addons/website/static/src/scss/website.navbar.scss deleted file mode 100644 index bde5abb7ca4..00000000000 --- a/addons/website/static/src/scss/website.navbar.scss +++ /dev/null @@ -1,20 +0,0 @@ -// Emulate navbar backend values and avoid website customizations - -#oe_main_menu_navbar.o_main_navbar { - .o_menu_brand, .o_menu_toggle { - display: inline-block; - font-size: 17px; - } - - .o_menu_sections, .o_menu_systray { - &, > div { - > a, > button, > label { - font-size: 14px; - } - } - - > .o_mobile_preview > a { - font-size: 17px; - } - } -} diff --git a/addons/website/static/src/scss/website.ui.scss b/addons/website/static/src/scss/website.ui.scss index c5dc67003cb..c040bb19719 100644 --- a/addons/website/static/src/scss/website.ui.scss +++ b/addons/website/static/src/scss/website.ui.scss @@ -105,371 +105,6 @@ body { // rtlcss for right-to-left text direction. direction: ltr; } -body.o_connected_user { - padding-top: $o-navbar-height!important; - - &.o_fullscreen_transition { - transition: padding 400ms ease 0s; - - #oe_main_menu_navbar, #web_editor-top-edit, .o_we_website_top_actions, #oe_snippets { - transition: transform 400ms ease 0s !important; - } - .o_header_affixed { - transition: top 0.35s !important; - } - } - &.o_fullscreen { - padding-top: 0 !important; - - &.editor_enable.editor_has_snippets { - padding-right: 0 !important; - - .modal:not(.o_technical_modal) { - right: 0; - } - } - #oe_main_menu_navbar, #web_editor-top-edit { - transform: translateY(-100%); - } - .o_we_website_top_actions, #oe_snippets { - transform: translateX(100%); - } - .o_header_affixed { - top: 0 !important; - right: 0 !important; - } - } -} - -//FULLSCREEN INDICATION LAYOUT -.o_fullscreen_indication { - display: flex; - position: absolute; - width: 100%; - align-items: center; - justify-content: center; - top: 0; - margin-top: $o-navbar-height!important; - opacity: 0; - pointer-events: none; - - p { - padding: 15px 30px; - background-color: rgba(0, 0, 0, 0.7); - color: white; - span { - border: 1px solid white; - border-color: white; - border-radius: 5px; - padding: 7px 5px; - margin: 5px; - } - } - &.o_transition { - transition: opacity 400ms; - } - &.o_visible { - opacity: 1; - } -} - -// MAIN MENU STYLE (added above navbar.scss) -#oe_main_menu_navbar { - @include o-w-preserve-dropdown-menus; - @include o-position-absolute(0, 0, auto, 0); - position: fixed; - z-index: $zindex-modal - 10; - font-family: $o-we-font-family; - font-size: 14px; - - a:hover, a:focus { - text-decoration: none; - } - a.dropdown-toggle { - outline: none; - } - .dropdown-menu { - border-top: 0; - margin-top: 0; - background-clip: border-box; - font-size: inherit; - border-radius: 0; - color: $dropdown-link-active-color; - max-height: 500px; // Fallback - max-height: calc(90vh - #{$o-navbar-height}); - overflow: auto; - } - #oe_applications .dropdown-menu { - // Compensate #oe_applications's padding - margin-left: $dropdown-item-padding-x * -0.5; - } - - .o_menu_sections { - .o_mobile_preview a { - text-align: center; - font-size: 20px; - } - } - .o_menu_systray { - > li > a, > div > a { - &.css_edit_dynamic{ - padding: 0 $grid-gutter-width/4; - } - - &[data-action="edit"], &[data-action="translate"], &.css_edit_dynamic { - @include button-variant($o-brand-primary, $o-brand-primary); - &.active, &:hover, &:focus, &:active { - outline: none; - box-shadow: none !important; - } - } - - &, &:hover, &:focus { - text-decoration: none; - } - } - - .o_mobile_preview a { - text-align: center; - } - } - @include media-breakpoint-down(sm) { - #oe_applications { - position: inherit; - z-index: 1002; - } - } -} - -@mixin o-w-close-icon($size:12px, $color:#000, $color-hover:#000, $thickness: 1px, $opacity: 0.7, $opacity-hover: 1) { - color: transparent; - position: relative; - display: inline-block; - opacity: $opacity; - width: $size; - height: $size; - - &:hover, &:focus { - outline: none; - opacity: $opacity-hover; - - &::after, &::before { - background: $color-hover; - } - } - - &:after, &:before { - content: ''; - margin-top: -1px; - background: $color; - @include size(100%, $thickness); - @include o-position-absolute(50%, $left:0); - transform: rotate(45deg); - } - - &:after { - transform: rotate(-45deg); - } -} - -// MODALS -body .modal { - &.o_technical_modal { - @include o-w-preserve-base; - @include o-w-preserve-dropdown-menus; - @include o-w-preserve-headings; - @include o-w-preserve-forms; - @include o-w-preserve-links; - @include o-w-preserve-btn; - @include o-w-preserve-cards; - @include o-w-preserve-modals; - @include o-w-preserve-tabs; - } - - // MOBILE PREVIEW - &.oe_mobile_preview { - text-align: center; - - .modal-dialog { - display: inline-block; - width: auto; - - .modal-content { - background-color: black!important; - border: 3px outset gray; - border-radius: 20px; - - .modal-header { - border: none; - cursor: pointer; - font-family: $o-we-font-family; - - &, .close { - color: white; - } - - h4 { - font-family: inherit; - font-weight: normal; - color: inherit; - - .fa { - margin-left: $grid-gutter-width/2; - } - } - .close { - color: #4e525b; - } - } - - .modal-body { - background-color: inherit!important; - border-radius: 20px; - padding: 15px; - - $mobile-preview-width: 320px; - $mobile-preview-height: 530px; - - display: flex; - width: $mobile-preview-width + 15; - height: $mobile-preview-height; - transition: all 400ms ease 0s; - - &.o_invert_orientation { - width: $mobile-preview-height + 15; - height: $mobile-preview-width; - } - - > iframe { - display: block; - width: 100%; - border: none; - } - } - - .modal-footer { - display: none; - } - } - } - } - - // TOP MENU EDITOR - .oe_menu_editor { - ul { - padding-left: 37px; - } - - li { - margin-top: -1px; - - .input-group-addon { - border-radius: 0; - } - } - } - - // SEO CONFIGURATION - &.oe_seo_configuration { - #language-box { - padding-right: 25px; - background-color: white; - } - .o_seo_og_image { - .o_meta_img { - position: relative; - transition: border-color 200ms; - display: inline-block; - border: 2px solid gray('400'); - - > img { - width: 70px; - height: 70px; - object-fit: cover; - cursor: pointer; - } - - &:hover { - border-color: $o-brand-primary; - } - - &.o_active_image { - border-color: $o-brand-primary; - - &:before { - @include o-position-absolute($right: 0); - content: ''; - border: 16px solid rgba($o-brand-primary, 0.8); - border-left-color: transparent; - border-bottom-color: transparent; - } - - &:after { - @include o-position-absolute(2px, 3px); - display: inline-block; - content: "\f00c"; - font-family: FontAwesome; - color: white; - font-size: 12px; - } - } - .o-custom-label { - @include o-position-absolute($bottom: 0px); - background: rgba(gray('800'), 0.6); - font-size: 12px; - } - } - .o_meta_img_upload { - transition: 200ms; - display: inline-block; - padding: 23px 27px; - border: 3px dashed lighten(gray('700'), 30%); - vertical-align: top; - cursor: pointer; - color: lighten(gray('600'), 30%); - - &:hover { - border-color: $o-brand-primary; - color: $o-brand-primary; - } - } - .o_meta_active_img { - height: 240px; - object-fit: cover; - } - } - - div.oe_seo_preview_g { - list-style: none; - font-family: arial, sans-serif; - - .r { - cursor: pointer; - color:#1a0dab; - font-size: 18px; - overflow: hidden; - text-overflow: ellipsis; - -webkit-text-overflow: ellipsis; - white-space: nowrap; - } - - .s { - font-size: 13px; - line-height: 18px; - color: #545454; - .kv { - color: #006621; - font-size: 14px; - line-height: 18px; - } - } - } - - td.o_seo_keyword_suggestion span.o_seo_suggestion.badge { - cursor: pointer; - } - } -} // LOGIN FORM .oe_login_form, .oe_signup_form, .oe_reset_password_form { @@ -518,11 +153,6 @@ body .modal { } // Pages Management -.o_page_management_info { - .o_switch { - padding-top: 9px; - } -} #list_website_pages { th { background-color: $o-brand-odoo; @@ -545,18 +175,6 @@ body .modal { } } -// Page Properties -.o_redirect_old_url { - @include media-breakpoint-down(sm) { - // Because o_technical_modal class class has a higher z-index than $zindex-modal. - z-index: $o-we-technical-modal-zindex + ($zindex-popover - $zindex-modal); - } - .popover-body { - overflow-y: auto; - max-height: 14.2rem; - } -} - // Post Submit Links .post_link:not(.o_post_link_js_loaded) { pointer-events: none; diff --git a/addons/website/static/src/xml/website.editor.xml b/addons/website/static/src/xml/website.editor.xml index 1e867a3240b..d0928ad2213 100644 --- a/addons/website/static/src/xml/website.editor.xml +++ b/addons/website/static/src/xml/website.editor.xml @@ -1,13 +1,5 @@ - - - - diff --git a/addons/website/static/src/xml/website.xml b/addons/website/static/src/xml/website.xml index 731f5c089f1..e04722d5118 100644 --- a/addons/website/static/src/xml/website.xml +++ b/addons/website/static/src/xml/website.xml @@ -30,76 +30,4 @@
- - -

Don't forget to update all links referring to this page.

- -

We found these ones:

-
- - -
-
-
- -
-

Are you sure you want to delete this page ?

- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
- -
- -
-
-
- - - - - - - - - -
-

Press esc to exit full screen

-
diff --git a/addons/website/views/website_navbar_templates.xml b/addons/website/views/website_navbar_templates.xml index 6f3904bb5ae..c4290c336f1 100644 --- a/addons/website/views/website_navbar_templates.xml +++ b/addons/website/views/website_navbar_templates.xml @@ -1,24 +1,7 @@ - - - diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index 50c5586a693..647b435085a 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -2051,15 +2051,6 @@ - - @@ -2394,15 +2385,6 @@ Sitemap: sitemap.xml - -