-
- Name
-
-
-
+
`;
DuplicatePageDialog.props = {
- ...WebsiteDialog.props,
onClose: Function,
+ close: Function,
+ pageId: Number,
};
export class PagePropertiesDialogWrapper extends Component {
diff --git a/addons/website/static/src/components/dialog/page_properties.xml b/addons/website/static/src/components/dialog/page_properties.xml
index de63850fad3..903f2ac7b50 100644
--- a/addons/website/static/src/components/dialog/page_properties.xml
+++ b/addons/website/static/src/components/dialog/page_properties.xml
@@ -55,19 +55,24 @@
-
- Are you sure you want to delete this page ?
- Don't forget to update all links referring to this page.
-
-
- I am sure about this.
-
-
+
+
+ Are you sure you want to delete this page ?
+ Don't forget to update all links referring to this page.
+
+
+ I am sure about this.
+
-
-
- !state.confirm
-
+
+
+ Ok
+
+
+ Cancel
+
+
+
diff --git a/addons/website/static/src/components/dialog/seo.js b/addons/website/static/src/components/dialog/seo.js
index b5045cd6a28..1d82e1bd820 100644
--- a/addons/website/static/src/components/dialog/seo.js
+++ b/addons/website/static/src/components/dialog/seo.js
@@ -1,6 +1,6 @@
/** @odoo-module **/
-import { useService, useListener } from '@web/core/utils/hooks';
+import { useService } from '@web/core/utils/hooks';
import { MediaDialog } from '@web_editor/components/media_dialog/media_dialog';
import { WebsiteDialog } from './dialog';
@@ -327,18 +327,17 @@ TitleDescription.components = {
SEOPreview,
};
-export class OptimizeSEODialog extends WebsiteDialog {
+export class OptimizeSEODialog extends Component {
setup() {
- super.setup();
this.rpc = useService('rpc');
this.website = useService('website');
this.dialogs = useService('dialog');
this.orm = useService('orm');
this.title = this.env._t("Optimize SEO");
- this.primaryTitle = this.env._t("Save");
- this.size = 'modal-lg';
- this.contentClass = `${this.contentClass} oe_seo_configuration`;
+ this.saveButton = this.env._t("Save");
+ this.size = 'lg';
+ this.contentClass = "oe_seo_configuration";
onWillStart(async () => {
const { metadata: { mainObject, seoObject, path } } = this.website.currentWebsite;
@@ -405,7 +404,7 @@ export class OptimizeSEODialog extends WebsiteDialog {
return el && el.content;
}
- async primaryClick() {
+ async save() {
const data = {};
if (this.canEditTitle) {
data.website_meta_title = seoContext.title;
@@ -423,12 +422,12 @@ export class OptimizeSEODialog extends WebsiteDialog {
}
data.website_meta_og_img = seoContext.metaImage;
await this.orm.write(this.object.model, [this.object.id], data);
- this.close();
this.website.goToWebsite({path: this.url.replace(this.previousSeoName || this.seoNameDefault, seoContext.seoName)});
}
}
-OptimizeSEODialog.bodyTemplate = 'website.OptimizeSEODialog';
+OptimizeSEODialog.template = 'website.OptimizeSEODialog';
OptimizeSEODialog.components = {
+ WebsiteDialog,
TitleDescription,
ImageSelector,
MetaKeywords,
diff --git a/addons/website/static/src/components/dialog/seo.xml b/addons/website/static/src/components/dialog/seo.xml
index a9db65c9b66..763a6b042d2 100644
--- a/addons/website/static/src/components/dialog/seo.xml
+++ b/addons/website/static/src/components/dialog/seo.xml
@@ -166,20 +166,27 @@
-
-
-
+
+
+
+
+
diff --git a/addons/website/static/src/components/translator/translator.js b/addons/website/static/src/components/translator/translator.js
index 7cb5fa3255f..056e441a10c 100644
--- a/addons/website/static/src/components/translator/translator.js
+++ b/addons/website/static/src/components/translator/translator.js
@@ -4,13 +4,12 @@ import { WebsiteEditorComponent } from '../editor/editor';
import { WebsiteDialog } from '../dialog/dialog';
import localStorage from 'web.local_storage';
-const { useEffect, useRef } = owl;
+const { useEffect, useRef, Component } = owl;
const localStorageNoDialogKey = 'website_translator_nodialog';
-class AttributeTranslateDialog extends WebsiteDialog {
+class AttributeTranslateDialog extends Component {
setup() {
- super.setup();
this.title = this.env._t("Translate Attribute");
this.formEl = useRef('form-container');
@@ -38,10 +37,21 @@ class AttributeTranslateDialog extends WebsiteDialog {
}, () => [this.props.node]);
}
}
-AttributeTranslateDialog.bodyTemplate = 'website.AttributeTranslateDialog';
+AttributeTranslateDialog.components = { WebsiteDialog };
+AttributeTranslateDialog.template = 'website.AttributeTranslateDialog';
-class TranslatorInfoDialog extends WebsiteDialog {}
-TranslatorInfoDialog.bodyTemplate = 'website.TranslatorInfoDialog';
+class TranslatorInfoDialog extends Component {
+ setup() {
+ this.strongOkButton = this.env._t("Ok, never show me this again");
+ this.okButton = this.env._t("Ok");
+ }
+
+ onStrongOkClick() {
+ localStorage.setItem(localStorageNoDialogKey, true);
+ }
+}
+TranslatorInfoDialog.components = { WebsiteDialog };
+TranslatorInfoDialog.template = 'website.TranslatorInfoDialog';
const savableSelector = '[data-oe-translation-id], ' +
'[data-oe-model][data-oe-id][data-oe-field], ' +
@@ -183,11 +193,7 @@ export class WebsiteTranslator extends WebsiteEditorComponent {
});
if (!localStorage.getItem(localStorageNoDialogKey)) {
- this.dialogService.add(TranslatorInfoDialog, {
- primaryClick: () => localStorage.setItem(localStorageNoDialogKey, true),
- primaryTitle: this.env._t("Ok, never show me this again"),
- secondaryTitle: this.env._t("Ok"),
- });
+ this.dialogService.add(TranslatorInfoDialog);
}
// Apply data-oe-readonly on nested data.
@@ -228,7 +234,7 @@ export class WebsiteTranslator extends WebsiteEditorComponent {
});
this.$translations.prependEvent('click.translator', (ev) => {
- this.dialogService.add(AttributeTranslateDialog, { node: ev.target, showSecondaryButton: false });
+ this.dialogService.add(AttributeTranslateDialog, { node: ev.target });
});
}
diff --git a/addons/website/static/src/components/translator/translator.scss b/addons/website/static/src/components/translator/translator.scss
index 18524f0ed45..ce3d432fad0 100644
--- a/addons/website/static/src/components/translator/translator.scss
+++ b/addons/website/static/src/components/translator/translator.scss
@@ -3,10 +3,10 @@
margin: 10px;
padding: 4px;
- [data-oe-translation-state] {
+ &[data-oe-translation-state] {
background: $o-we-translated-content-color;
}
- [data-oe-translation-state="to_translate"] {
+ &[data-oe-translation-state="to_translate"] {
background: $o-we-content-to-translate-color;
}
}
diff --git a/addons/website/static/src/components/translator/translator.xml b/addons/website/static/src/components/translator/translator.xml
index e4dd94f333e..a4c0c03a1ef 100644
--- a/addons/website/static/src/components/translator/translator.xml
+++ b/addons/website/static/src/components/translator/translator.xml
@@ -1,19 +1,29 @@
-
You are about to enter the translation mode.
-
Here are the visuals used to help you translate efficiently:
-
- Content to translate
- Translated content
-
-
- In this mode, you can only translate texts. To change the structure of the page, you must edit the master page.
- Each modification on the master page is automatically applied to all translated versions.
-
+
+ You are about to enter the translation mode.
+ Here are the visuals used to help you translate efficiently:
+
+ Content to translate
+ Translated content
+
+
+ In this mode, you can only translate texts. To change the structure of the page, you must edit the master page.
+ Each modification on the master page is automatically applied to all translated versions.
+
+
-
+
+
+
+
+
diff --git a/addons/website/static/src/services/website_service.js b/addons/website/static/src/services/website_service.js
index 7fdc5929c03..f659a11bf9a 100644
--- a/addons/website/static/src/services/website_service.js
+++ b/addons/website/static/src/services/website_service.js
@@ -128,8 +128,8 @@ export const websiteService = {
clearBreadcrumbs: true,
additionalContext: {
params: {
- website_id: websiteId,
- path,
+ website_id: websiteId || currentWebsiteId,
+ path: path || (contentWindow && contentWindow.location.href) || '/',
enable_editor: edition,
edit_translations: translation,
},
diff --git a/addons/website/static/src/systray_items/new_content.js b/addons/website/static/src/systray_items/new_content.js
index 03b89741e8e..e3b1853891f 100644
--- a/addons/website/static/src/systray_items/new_content.js
+++ b/addons/website/static/src/systray_items/new_content.js
@@ -37,6 +37,19 @@ NewContentElement.defaultProps = {
status: MODULE_STATUS.INSTALLED,
};
+class InstallModuleDialog extends Component {
+ setup() {
+ this.installButton = this.env._t("Install");
+ }
+
+ onClickInstall() {
+ this.props.close();
+ this.props.installModule();
+ }
+}
+InstallModuleDialog.components = { WebsiteDialog };
+InstallModuleDialog.template = "website.InstallModuleDialog";
+
export class NewContentModal extends Component {
setup() {
this.user = useService('user');
@@ -158,9 +171,8 @@ export class NewContentModal extends Component {
const {id, name} = this.modulesInfo[element.moduleXmlId];
const dialogProps = {
title: element.title,
- body: _.str.sprintf(this.newContentText.installNeeded, name),
- primaryTitle: this.env._t("Install"),
- primaryClick: async () => {
+ installationText: _.str.sprintf(this.newContentText.installNeeded, name),
+ installModule: async () => {
// Update the NewContentElement with installing icon and text.
this.state.newContentElements = this.state.newContentElements.map(el => {
if (el.moduleXmlId === element.moduleXmlId) {
@@ -186,7 +198,7 @@ export class NewContentModal extends Component {
}
},
};
- this.dialogs.add(WebsiteDialog, dialogProps);
+ this.dialogs.add(InstallModuleDialog, dialogProps);
}
}
NewContentModal.template = "website.NewContentModal";
diff --git a/addons/website/static/src/systray_items/new_content.xml b/addons/website/static/src/systray_items/new_content.xml
index 2aec401921f..e879319ab2e 100644
--- a/addons/website/static/src/systray_items/new_content.xml
+++ b/addons/website/static/src/systray_items/new_content.xml
@@ -41,4 +41,13 @@