[IMP] *: convert dialog title to t-out
Need to check and mark legit uses of HTML as Markup. Also fix some title formattings which are not great (mostly around translations) and de-escape titles which don't need to be escaped anymore.
This commit is contained in:
+1
-1
@@ -30,7 +30,7 @@ const PartnerInviteDialog = Dialog.extend({
|
||||
this.channelId = channel.id;
|
||||
this.env = env;
|
||||
this._super(parent, {
|
||||
title: _.str.sprintf(this.env._t("Invite people to #%s"), owl.utils.escape(channel.displayName)),
|
||||
title: _.str.sprintf(this.env._t("Invite people to #%s"), channel.displayName),
|
||||
size: 'medium',
|
||||
buttons: [{
|
||||
text: this.env._t("Invite"),
|
||||
|
||||
@@ -75,7 +75,7 @@ odoo.define('payment.payment_form_mixin', require => {
|
||||
const $checkedRadios = this.$('input[name="o_payment_radio"]:checked');
|
||||
if ($checkedRadios.length !== 1) { // Cannot find selected payment option, show dialog
|
||||
return new Dialog(null, {
|
||||
title: _.str.sprintf(_t("Error: %s"), _.str.escapeHTML(title)),
|
||||
title: _.str.sprintf(_t("Error: %s"), title),
|
||||
size: 'medium',
|
||||
$content: `<p>${_.str.escapeHTML(description) || ''}</p>`,
|
||||
buttons: [{text: _t("Ok"), close: true}]
|
||||
|
||||
@@ -410,7 +410,7 @@ var FieldMany2One = AbstractField.extend({
|
||||
domain: this.record.getDomain({fieldName: this.name}),
|
||||
context: _.extend({}, this.record.getContext(this.recordParams), context || {}),
|
||||
dynamicFilters: dynamicFilters || [],
|
||||
title: (view === 'search' ? _t("Search: ") : _t("Create: ")) + this.string,
|
||||
title: _.str.sprintf((view === 'search' ? _t("Search: %s") : _t("Create: %s")), this.string),
|
||||
initial_ids: ids,
|
||||
initial_view: view,
|
||||
disable_multiple_selection: true,
|
||||
|
||||
@@ -411,7 +411,7 @@ var CalendarController = AbstractController.extend({
|
||||
res_model: self.modelName,
|
||||
res_id: id || null,
|
||||
context: event.context || self.context,
|
||||
title: _t("Open: ") + _.escape(event.data.title),
|
||||
title: _.str.sprintf(_t("Open: %s"), event.data.title),
|
||||
on_saved: function () {
|
||||
if (event.data.on_save) {
|
||||
event.data.on_save();
|
||||
|
||||
@@ -42,7 +42,7 @@ odoo.define('web.TranslationDialog', function (require) {
|
||||
|
||||
this._super(parent, _.extend({
|
||||
size: 'large',
|
||||
title: _t('Translate: ') + `${this.fieldName}`,
|
||||
title: _.str.sprintf(_t('Translate: %s'), this.fieldName),
|
||||
buttons: [
|
||||
{ text: _t('Save'), classes: 'btn-primary', close: true, click: this._onSave.bind(this) },
|
||||
{ text: _t('Discard'), close: true },
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<header t-if="renderHeader" class="modal-header">
|
||||
<h4 class="modal-title"><t t-raw="title"/><span class="o_subtitle text-muted small" t-esc="subtitle"/></h4>
|
||||
<h4 class="modal-title"><t t-out="title"/><span class="o_subtitle text-muted small" t-out="subtitle"/></h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close" tabindex="-1">×</button>
|
||||
</header>
|
||||
<main class="modal-body"/>
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
odoo.define('website.mobile', function (require) {
|
||||
'use strict';
|
||||
|
||||
var core = require('web.core');
|
||||
const {_t} = require('web.core');
|
||||
const {Markup} = require('web.utils');
|
||||
var Dialog = require('web.Dialog');
|
||||
var websiteNavbarData = require('website.navbar');
|
||||
|
||||
const { registry } = require("@web/core/registry");
|
||||
|
||||
var _t = core._t;
|
||||
|
||||
var MobilePreviewDialog = Dialog.extend({
|
||||
/**
|
||||
* Tweaks the modal so that it appears as a phone and modifies the iframe
|
||||
@@ -56,7 +55,7 @@ var MobileMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({
|
||||
return this.mobilePreview.close();
|
||||
}
|
||||
this.mobilePreview = new MobilePreviewDialog(this, {
|
||||
title: _t('Mobile preview') + ' <span class="fa fa-refresh"/>',
|
||||
title: Markup(_.escape(_t('Mobile preview')) + ' <span class="fa fa-refresh"/>'),
|
||||
}).open();
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user