From c5904fdda457200494128ca1d685ee2d378444da Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 16 Aug 2022 20:01:18 +0300 Subject: [PATCH] text usage --- .../crm/src/views/record/panels/activities.js | 12 ++++++--- .../views/record/row-actions/activities.js | 27 +++++++++---------- .../src/views/record/row-actions/history.js | 4 +-- .../record/row-actions/relationship-target.js | 7 +++-- .../crm/src/views/record/row-actions/tasks.js | 5 ++-- .../templates/record/row-actions/default.tpl | 2 +- 6 files changed, 30 insertions(+), 27 deletions(-) diff --git a/client/modules/crm/src/views/record/panels/activities.js b/client/modules/crm/src/views/record/panels/activities.js index 577510a6e5..c282d73918 100644 --- a/client/modules/crm/src/views/record/panels/activities.js +++ b/client/modules/crm/src/views/record/panels/activities.js @@ -206,7 +206,7 @@ define('crm:views/record/panels/activities', let o = { action: 'createActivity', - html: this.translate(label, 'labels', scope), + text: this.translate(label, 'labels', scope), data: {}, acl: 'create', aclScope: scope, @@ -278,9 +278,15 @@ define('crm:views/record/panels/activities', let o = { action: 'viewRelatedList', - html: this.translate('View List') + ' · ' + this.translate(scope, 'scopeNamesPlural') + '', + html: $('') + .append( + $('').text(this.translate('View List')), + ' · ', + $('').text(this.translate(scope, 'scopeNamesPlural')), + ) + .get(0).innerHTML, data: { - scope: scope + scope: scope, }, acl: 'read', aclScope: scope, diff --git a/client/modules/crm/src/views/record/row-actions/activities.js b/client/modules/crm/src/views/record/row-actions/activities.js index fbf21c2978..2a1730dfa8 100644 --- a/client/modules/crm/src/views/record/row-actions/activities.js +++ b/client/modules/crm/src/views/record/row-actions/activities.js @@ -26,7 +26,7 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('crm:views/record/row-actions/activities', 'views/record/row-actions/relationship', function (Dep) { +define('crm:views/record/row-actions/activities', ['views/record/row-actions/relationship'], function (Dep) { return Dep.extend({ @@ -35,9 +35,9 @@ define('crm:views/record/row-actions/activities', 'views/record/row-actions/rela action: 'quickView', label: 'View', data: { - id: this.model.id + id: this.model.id, }, - link: '#' + this.model.name + '/view/' + this.model.id + link: '#' + this.model.name + '/view/' + this.model.id, }]; if (this.options.acl.edit) { @@ -45,26 +45,26 @@ define('crm:views/record/row-actions/activities', 'views/record/row-actions/rela action: 'quickEdit', label: 'Edit', data: { - id: this.model.id + id: this.model.id, }, - link: '#' + this.model.name + '/edit/' + this.model.id + link: '#' + this.model.name + '/edit/' + this.model.id, }); - if (this.model.name == 'Meeting' || this.model.name == 'Call') { + if (this.model.entityType === 'Meeting' || this.model.entityType === 'Call') { list.push({ action: 'setHeld', - html: this.translate('Set Held', 'labels', 'Meeting'), + text: this.translate('Set Held', 'labels', 'Meeting'), data: { - id: this.model.id - } + id: this.model.id, + }, }); list.push({ action: 'setNotHeld', - html: this.translate('Set Not Held', 'labels', 'Meeting'), + text: this.translate('Set Not Held', 'labels', 'Meeting'), data: { - id: this.model.id - } + id: this.model.id, + }, }); } } @@ -74,13 +74,12 @@ define('crm:views/record/row-actions/activities', 'views/record/row-actions/rela action: 'removeRelated', label: 'Remove', data: { - id: this.model.id + id: this.model.id, } }); } return list; }, - }); }); diff --git a/client/modules/crm/src/views/record/row-actions/history.js b/client/modules/crm/src/views/record/row-actions/history.js index 2b7e727d56..e86780a3f2 100644 --- a/client/modules/crm/src/views/record/row-actions/history.js +++ b/client/modules/crm/src/views/record/row-actions/history.js @@ -40,10 +40,10 @@ define('crm:views/record/row-actions/history', 'views/record/row-actions/relatio link: '#' + this.model.name + '/view/' + this.model.id }]; - if (this.model.name == 'Email') { + if (this.model.entityType === 'Email') { list.push({ action: 'reply', - html: this.translate('Reply', 'labels', 'Email'), + text: this.translate('Reply', 'labels', 'Email'), data: { id: this.model.id } diff --git a/client/modules/crm/src/views/record/row-actions/relationship-target.js b/client/modules/crm/src/views/record/row-actions/relationship-target.js index aecd99a0ae..d2db7b1ee2 100644 --- a/client/modules/crm/src/views/record/row-actions/relationship-target.js +++ b/client/modules/crm/src/views/record/row-actions/relationship-target.js @@ -26,7 +26,7 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('crm:views/record/row-actions/relationship-target', 'views/record/row-actions/relationship-unlink-only', function (Dep) { +define('crm:views/record/row-actions/relationship-target', ['views/record/row-actions/relationship-unlink-only'], function (Dep) { return Dep.extend({ @@ -37,7 +37,7 @@ define('crm:views/record/row-actions/relationship-target', 'views/record/row-act if (this.model.get('isOptedOut')) { list.push({ action: 'cancelOptOut', - html: this.translate('Cancel Opt-Out', 'labels', 'TargetList'), + text: this.translate('Cancel Opt-Out', 'labels', 'TargetList'), data: { id: this.model.id } @@ -45,7 +45,7 @@ define('crm:views/record/row-actions/relationship-target', 'views/record/row-act } else { list.push({ action: 'optOut', - html: this.translate('Opt-Out', 'labels', 'TargetList'), + text: this.translate('Opt-Out', 'labels', 'TargetList'), data: { id: this.model.id } @@ -55,6 +55,5 @@ define('crm:views/record/row-actions/relationship-target', 'views/record/row-act return list; }, - }); }); diff --git a/client/modules/crm/src/views/record/row-actions/tasks.js b/client/modules/crm/src/views/record/row-actions/tasks.js index da4e438ffb..b419256015 100644 --- a/client/modules/crm/src/views/record/row-actions/tasks.js +++ b/client/modules/crm/src/views/record/row-actions/tasks.js @@ -26,7 +26,7 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('crm:views/record/row-actions/tasks', 'views/record/row-actions/relationship-no-unlink', function (Dep) { +define('crm:views/record/row-actions/tasks', ['views/record/row-actions/relationship-no-unlink'], function (Dep) { return Dep.extend({ @@ -53,7 +53,7 @@ define('crm:views/record/row-actions/tasks', 'views/record/row-actions/relations if (!~['Completed', 'Canceled'].indexOf(this.model.get('status'))) { list.push({ action: 'Complete', - html: this.translate('Complete', 'labels', 'Task'), + text: this.translate('Complete', 'labels', 'Task'), data: { id: this.model.id } @@ -73,6 +73,5 @@ define('crm:views/record/row-actions/tasks', 'views/record/row-actions/relations return list; }, - }); }); diff --git a/client/res/templates/record/row-actions/default.tpl b/client/res/templates/record/row-actions/default.tpl index e35a1af8ce..7d0579d221 100644 --- a/client/res/templates/record/row-actions/default.tpl +++ b/client/res/templates/record/row-actions/default.tpl @@ -16,7 +16,7 @@ {{#each data}} data-{{@key}}="{{./this}}" {{/each}} - >{{#if html}}{{{html}}}{{else}}{{translate label scope=../scope}}{{/if}} + >{{#if html}}{{{html}}}{{else}}{{#if text}}{{text}}{{else}}{{translate label scope=../scope}}{{/if}}{{/if}} {{/each}}