[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
This commit is contained in:
committed by
qsm-odoo
parent
03c552690b
commit
e5b094b683
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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($('<div/>', {
|
||||
class: 'dropdown-divider',
|
||||
role: 'separator',
|
||||
}));
|
||||
}
|
||||
_.each(result, function (item) {
|
||||
if (currentGroup !== item.inherit_id[1]) {
|
||||
currentGroup = item.inherit_id[1];
|
||||
$menu.append('<li class="dropdown-header">' + currentGroup + '</li>');
|
||||
}
|
||||
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;
|
||||
});
|
||||
@@ -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);
|
||||
@@ -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,
|
||||
};
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
<!-- Custom checkbox (material-design-like toggle) -->
|
||||
<t t-name="website.components.switch">
|
||||
<label class="o_switch dropdown-item m-0" t-att-for="id">
|
||||
<input type="checkbox" t-att-id="id" t-att-checked="checked ? 'checked' : undefined"/>
|
||||
<span/>
|
||||
<div t-if="label"><t t-esc="label"/></div>
|
||||
</label>
|
||||
</t>
|
||||
|
||||
<t t-extend="wysiwyg.widgets.link">
|
||||
<t t-jquery="#o_link_dialog_url_input" t-operation="after">
|
||||
|
||||
@@ -30,76 +30,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-name="website.dependencies">
|
||||
<p class="text-warning">Don't forget to update all links referring to this page.</p>
|
||||
<t t-if="dependencies and _.keys(dependencies).length">
|
||||
<p class="text-warning">We found these ones:</p>
|
||||
<div t-foreach="dependencies" t-as="type" class="mb16">
|
||||
<a class="collapsed fa fa-caret-right" data-toggle="collapse" t-attf-href="#collapseDependencies#{type_index}" aria-expanded="false" t-attf-aria-controls="collapseDependencies#{type_index}">
|
||||
<t t-esc="type"/>&nbsp;
|
||||
<span class="text-muted"><t t-esc="type_value.length"/> found(s)</span>
|
||||
</a>
|
||||
<div t-attf-id="collapseDependencies#{type_index}" class="collapse" aria-expanded="false">
|
||||
<ul>
|
||||
<li t-foreach="type_value" t-as="error">
|
||||
<a t-if="!_.contains(['', '#', false], error.link)" t-att-href="error.link">
|
||||
<t t-out="error.text"/>
|
||||
</a>
|
||||
<t t-else="">
|
||||
<t t-out="error.text"/>
|
||||
</t>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
<div t-name="website.delete_page">
|
||||
<p>Are you sure you want to delete this page ?</p>
|
||||
<t t-call="website.dependencies"/>
|
||||
</div>
|
||||
|
||||
<div t-name="website.rename_page">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form>
|
||||
<div class="form-group row mb0">
|
||||
<label for="new_name" class="col-form-label col-md-4">Rename Page To:</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" id="new_name" placeholder="e.g. About Us"/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<t t-call="website.dependencies"/>
|
||||
</div>
|
||||
|
||||
<div t-name="website.duplicate_page_action_dialog">
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3" for="page_name">Page Name</label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" id="page_name"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<t t-name="website.oe_applications_menu">
|
||||
<t t-as="menu" t-foreach="menu_data.children">
|
||||
<a role="menuitem" class="dropdown-item"
|
||||
t-att-data-action-id="menu.action ? menu.action.split(',')[1] : undefined"
|
||||
t-att-data-action-model="menu.action ? menu.action.split(',')[0] : undefined"
|
||||
t-att-data-menu="menu.id"
|
||||
t-att-data-menu-xmlid="menu.xmlid"
|
||||
t-att-href="_.str.sprintf('/web#menu_id=%s&action=%s', menu.id, menu.action ? menu.action.split(',')[1] : '')">
|
||||
<span class="oe_menu_text" t-esc="menu.name"/>
|
||||
</a>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
<div t-name="website.fullscreen_indication" class="o_fullscreen_indication">
|
||||
<p>Press <span>esc</span> to exit full screen</p>
|
||||
</div>
|
||||
</templates>
|
||||
|
||||
@@ -1,24 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<!-- publish/unpublish button -->
|
||||
<template id="website_publisher" name="Website Publisher">
|
||||
<t groups="website.group_website_publisher" t-if="'website_published' in main_object.fields_get() and ('can_publish' not in main_object.fields_get() or main_object.can_publish)">
|
||||
<div t-attf-class="js_publish_management #{extra_classes} #{main_object.website_published and 'css_published' or 'css_unpublished'}" t-att-data-description="env['ir.model']._get(main_object._name).display_name" t-att-data-id="main_object.id" t-att-data-object="main_object._name" t-att-data-controller="publish_controller">
|
||||
<label class="o_switch o_switch_danger_success js_publish_btn m-0" t-att-accesskey="desktop_navbar and 'p'">
|
||||
<input type="checkbox" disabled="disabled" t-att-checked="main_object.website_published"/>
|
||||
<span/>
|
||||
<span class="css_publish">Unpublished</span>
|
||||
<span class="css_unpublish">Published</span>
|
||||
</label>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<!-- Front-end/Back-end integration -->
|
||||
<template id="user_navbar" inherit_id="website.layout" name="User Navbar">
|
||||
<xpath expr="//t[@t-set='html_data']" position="after">
|
||||
<t t-set="body_classname" t-value="(body_classname if body_classname else '') + (' o_connected_user' if env['ir.ui.view'].user_has_groups('base.group_user') else '')"/>
|
||||
</xpath>
|
||||
<xpath expr="//div[@id='wrapwrap']" position="before">
|
||||
<div t-if="'with_loader' in request.params" class="o_theme_install_loader_container position-fixed fixed-top fixed-left
|
||||
h-100 w-100 d-flex flex-column align-items-center text-white font-weight-bold text-center">
|
||||
@@ -30,127 +13,6 @@
|
||||
<br/>pointer to build the perfect page in 7 steps.
|
||||
</p>
|
||||
</div>
|
||||
<nav groups="base.group_user" t-if="website" id="oe_main_menu_navbar" class="o_main_navbar d-flex align-items-center">
|
||||
<div t-cache="website" id="oe_applications">
|
||||
<div class="dropdown active pl-3">
|
||||
<a class="dropdown-toggle full" data-toggle="dropdown" href="#" accesskey="h">
|
||||
<i class="fa fa-th-large mr-2"/> WEBSITE
|
||||
</a>
|
||||
<div class="dropdown-menu" role="menu">
|
||||
<!-- This will be populated on hover in JS -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn fa fa-bars float-right ml-auto d-block d-md-none o_mobile_menu_toggle" aria-label="Menu" title="Menu" groups="website.group_website_designer"/>
|
||||
|
||||
<div class="o_menu_sections d-flex flex-grow-1 flex-shrink-1" groups="website.group_website_designer">
|
||||
<!-- Content -->
|
||||
<div t-if="editable" class="dropdown" id="content-menu">
|
||||
<a id="content-menu-button" class="dropdown-toggle o-no-caret waves" data-toggle="dropdown" data-display="static" href="#">Pages</a>
|
||||
<div class="dropdown-menu" role="menu">
|
||||
<a role="menuitem" href="/website/pages" title="Manage Your Website Pages" class="dropdown-item">Manage Pages</a>
|
||||
<div t-if="deletable" role="separator" class="dropdown-divider"/>
|
||||
<a role="menuitem" href="#" data-action="page_properties" class="dropdown-item" t-if="deletable">Page Properties</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Customize -->
|
||||
<div class="dropdown" id="customize-menu">
|
||||
<a class="dropdown-toggle o-no-caret waves" data-toggle="dropdown" data-display="static" href="#">Customize</a>
|
||||
<div class="dropdown-menu" role="menu">
|
||||
<a role="menuitem" href="#" data-action="ace" class="dropdown-item" id="html_editor">HTML/CSS/JS Editor</a>
|
||||
<a role="menuitem" href="/web#action=website.action_website_add_features" class="dropdown-item" id="install_apps">Add Features</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Promote -->
|
||||
<div class="dropdown" id="promote-menu">
|
||||
</div>
|
||||
<t t-call="website.website_publisher" groups="website.group_website_publisher">
|
||||
<t t-set="extra_classes" t-translation="off">d-flex d-sm-flex d-md-none</t>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
<div class="o_menu_systray d-none d-md-flex" groups="website.group_website_publisher">
|
||||
<!-- Mobile preview -->
|
||||
<div class="o_mobile_preview o_menu_systray_item" id="mobile-menu">
|
||||
<a data-action="show-mobile-preview" href="#" accesskey="v"><span title="Mobile preview" role="img" aria-label="Mobile preview" class="fa fa-lg fa-mobile"/></a>
|
||||
</div>
|
||||
|
||||
<!-- Page Edition -->
|
||||
<div class="o_new_content_menu o_menu_systray_item" id="new-content-menu">
|
||||
<a href="#" accesskey="c"><span class="fa fa-plus mr-1"/>New</a>
|
||||
<div id="o_new_content_menu_choices" class="o_hidden">
|
||||
<div class="container pt32 pb32">
|
||||
<div class="row">
|
||||
<t t-set="is_system" t-value="env.user.has_group('base.group_system')"/>
|
||||
<t t-set="is_designer" t-value="env.user.has_group('website.group_website_designer')"/>
|
||||
|
||||
<t t-set="mod" t-value="env.ref('base.module_website_blog')"/>
|
||||
<div name="module_website_blog" t-if='is_system' t-cache="is_system"
|
||||
t-att-data-module-id="mod.id"
|
||||
t-att-data-module-shortdesc="mod.shortdesc"
|
||||
class="col-md-4 mb8 o_new_content_element">
|
||||
<a href="#" data-action="new_blog_post">
|
||||
<i class="fa fa-rss"/>
|
||||
<p>Blog Post</p>
|
||||
</a>
|
||||
</div>
|
||||
<t t-set="mod" t-value="env.ref('base.module_website_event')"/>
|
||||
<div name="module_website_event" t-if='is_system' t-cache="is_system"
|
||||
t-att-data-module-id="mod.id"
|
||||
t-att-data-module-shortdesc="mod.shortdesc"
|
||||
class="col-md-4 mb8 o_new_content_element">
|
||||
<a href="#" data-action="new_event">
|
||||
<i class="fa fa-ticket"/>
|
||||
<p>Event</p>
|
||||
</a>
|
||||
</div>
|
||||
<t t-set="mod" t-value="env.ref('base.module_website_forum')"/>
|
||||
<div name="module_website_forum" t-if='is_system' t-cache="is_system"
|
||||
t-att-data-module-id="mod.id"
|
||||
t-att-data-module-shortdesc="mod.shortdesc"
|
||||
class="col-md-4 mb8 o_new_content_element o_new_content_element_once">
|
||||
<a href="#" data-url="/forum" data-action="new_forum">
|
||||
<i class="fa fa-comment"/>
|
||||
<p>Forum</p>
|
||||
</a>
|
||||
</div>
|
||||
<t t-set="mod" t-value="env.ref('base.module_website_slides')"/>
|
||||
<div name="module_website_slides" t-if='is_system' t-cache="is_system"
|
||||
t-att-data-module-id="mod.id"
|
||||
t-att-data-module-shortdesc="mod.shortdesc"
|
||||
class="col-md-4 mb8 o_new_content_element">
|
||||
<a href="#" data-action="new_slide_channel">
|
||||
<i class="fa module_icon" style="background-image: url('/website/static/src/img/apps_thumbs/website_slide.svg');
|
||||
background-repeat: no-repeat; background-position: center;"/>
|
||||
<p>Course</p>
|
||||
</a>
|
||||
</div>
|
||||
<t t-set="mod" t-value="env.ref('base.module_website_livechat')"/>
|
||||
<div name="module_website_livechat" t-if='is_system' t-cache="is_system"
|
||||
t-att-data-module-id="mod.id"
|
||||
t-att-data-module-shortdesc="mod.shortdesc"
|
||||
class="col-md-4 mb8 o_new_content_element o_new_content_element_once">
|
||||
<a href="#" data-url="/livechat" data-action="new_channel">
|
||||
<i class="fa fa-comments"/>
|
||||
<p>Livechat Widget</p>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div t-if="not translatable" id="edit-page-menu" class="o_menu_systray_item">
|
||||
<a data-action="edit" href="#" accesskey="a"><span class="fa fa-pencil mr-1"/>Edit</a>
|
||||
</div>
|
||||
<div t-if="translatable">
|
||||
<a data-action="translate" href="#">TRANSLATE</a>
|
||||
</div>
|
||||
<div t-if="translatable">
|
||||
<a data-action="edit_master" href="#">or Edit Master</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
|
||||
@@ -2051,15 +2051,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template id="publish_short">
|
||||
<t groups="website.group_website_publisher" t-ignore="true">
|
||||
<div t-attf-class="float-right js_publish_management #{object.website_published and 'css_published' or 'css_unpublished'}" t-att-data-id="object.id" t-att-data-object="object._name" t-att-data-description="env['ir.model']._get(object._name).display_name" t-att-data-controller="publish_controller">
|
||||
<button t-attf-class="btn btn-danger js_publish_btn #{additionnal_btn_classes or ''}">Unpublished</button>
|
||||
<button t-attf-class="btn btn-success js_publish_btn #{additionnal_btn_classes or ''}">Published</button>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="pager" name="Pager" inherit_id="portal.pager">
|
||||
</template>
|
||||
|
||||
@@ -2394,15 +2385,6 @@ Sitemap: <t t-esc="url_root"/>sitemap.xml
|
||||
<span t-foreach="enumerate(parts)" t-as="part" t-att-class="'text-primary' if part[0] % 2 else None" t-esc="part[1]"/>
|
||||
</template>
|
||||
|
||||
<template id="index_management">
|
||||
<t groups="website.group_website_publisher" t-ignore="true">
|
||||
<div t-attf-class="float-right js_index_management #{object.website_indexed and 'css_published' or 'css_unpublished'}" t-att-data-id="object.id" t-att-data-object="object._name">
|
||||
<button class="btn btn-danger js_index_btn">Unindexed</button>
|
||||
<button class="btn btn-success js_index_btn">Indexed</button>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="list_website_pages" name="Website Pages Management">
|
||||
<t t-call="website.layout">
|
||||
<div id="wrap">
|
||||
|
||||
@@ -457,16 +457,6 @@ list of filtered posts (by date or tag).
|
||||
|
||||
<!-- ====== Technical Templates ============================================
|
||||
============================================================================ -->
|
||||
<!-- User Navbar -->
|
||||
<template id="user_navbar_inherit_website_blog" inherit_id="website.user_navbar">
|
||||
<xpath expr="//div[@id='o_new_content_menu_choices']//div[@name='module_website_blog']" position="attributes">
|
||||
<attribute name="name"/>
|
||||
<attribute name="t-att-data-module-id"/>
|
||||
<attribute name="t-att-data-module-shortdesc"/>
|
||||
<attribute name="t-if">is_designer</attribute>
|
||||
<attribute name="t-cache"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- Atom Feed -->
|
||||
<template id="blog_feed"><?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
'views/event_templates_page_registration.xml',
|
||||
'views/event_templates_page_misc.xml',
|
||||
'views/event_templates_widgets.xml',
|
||||
'views/website_templates.xml',
|
||||
'views/event_event_views.xml',
|
||||
'views/event_registration_views.xml',
|
||||
'views/event_tag_category_views.xml',
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
.o_connected_user .o_wevent_event {
|
||||
min-height: calc(98vh - 110px)
|
||||
}
|
||||
|
||||
.o_wevent_event {
|
||||
min-height: calc(98vh - 70px);
|
||||
|
||||
|
||||
// Multi-line event title, even in mobile mode
|
||||
nav > div > a.navbar-brand {
|
||||
text-overflow: revert;
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<!-- User Navbar -->
|
||||
<template id="user_navbar_inherit_website_event" inherit_id="website.user_navbar">
|
||||
<xpath expr="//div[@id='o_new_content_menu_choices']//div[@name='module_website_event']" position="attributes">
|
||||
<attribute name="name"/>
|
||||
<attribute name="t-att-data-module-id"/>
|
||||
<attribute name="t-att-data-module-shortdesc"/>
|
||||
<attribute name="t-if">is_designer</attribute>
|
||||
<attribute name="t-cache"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- User Navbar - Edit Options -->
|
||||
<template id="event_edit_options" inherit_id="website.user_navbar" name="Edit Event Options">
|
||||
<xpath expr="//div[@id='edit-page-menu']" position="after">
|
||||
<t t-if="main_object._name == 'event.event'" t-set="action" t-value="'event.action_event_view'"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
@@ -1698,17 +1698,5 @@
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<!-- User Navbar -->
|
||||
<template id="user_navbar_inherit_website_forum" inherit_id="website.user_navbar">
|
||||
<xpath expr="//div[@id='o_new_content_menu_choices']//div[@name='module_website_forum']" position="attributes">
|
||||
<attribute name="name"/>
|
||||
<attribute name="t-att-data-module-id"/>
|
||||
<attribute name="t-att-data-module-shortdesc"/>
|
||||
<attribute name="t-if">is_designer</attribute>
|
||||
<attribute name="t-cache"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<template id="share_page_menu" inherit_id="website.user_navbar">
|
||||
<xpath expr="//div[@id='promote-menu']" position="inside">
|
||||
<a href="/r" id="o_website_links_share_page" class="dropdown-item">
|
||||
<span title="Track this page to count clicks">Link Tracker</span>
|
||||
</a>
|
||||
</xpath>
|
||||
|
||||
</template>
|
||||
|
||||
<template id="create_shorten_url">
|
||||
<div class="o_website_links_create_tracked_url">
|
||||
<div class="container">
|
||||
|
||||
@@ -175,12 +175,5 @@
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<!-- User Navbar -->
|
||||
<template id="user_navbar_inherit_website_livechat" inherit_id="website.user_navbar">
|
||||
<xpath expr="//div[@id='o_new_content_menu_choices']//div[@name='module_website_livechat']" position="replace">
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -569,10 +569,6 @@ $truncate-limits: 2, 3, 10;
|
||||
line-height: 1.5rem; // necessary to align label correctly with radio button
|
||||
|
||||
}
|
||||
|
||||
.was-validated .form-check .form-check-label {
|
||||
@include o-w-preserve-base; // avoid ugly green when form is marked as 'was-validated'
|
||||
}
|
||||
}
|
||||
|
||||
.o_wslides_slide_upload_loading {
|
||||
|
||||
Reference in New Issue
Block a user