From e4d43a6790e085e96926c777397d154bcb2cbc93 Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 19 Apr 2018 13:11:20 +0300 Subject: [PATCH] fix field names conflict with template variables --- client/lib/bull.js | 3 +++ .../calendar/record/shared-options.tpl | 2 +- client/res/layout-types/list-row-expanded.tpl | 2 +- client/res/layout-types/list-row.tpl | 2 +- client/res/layout-types/record.tpl | 8 +++---- .../entity-manager/record/edit-formula.tpl | 2 +- .../admin/layouts/record/edit-attributes.tpl | 8 +++---- client/res/templates/export/record/record.tpl | 6 +++--- .../templates/record/panels/default-side.tpl | 12 +++++------ client/res/templates/record/panels/side.tpl | 2 +- client/res/templates/stream/record/edit.tpl | 12 +++++------ .../admin/layouts/record/edit-attributes.js | 14 ++++++++++++- client/src/views/record/base.js | 21 ++++++++++++++++--- client/src/views/record/detail-middle.js | 8 ++++++- client/src/views/record/detail.js | 6 +++++- client/src/views/record/list-expanded.js | 7 +++++-- client/src/views/record/list.js | 15 +++++++------ client/src/views/record/panels/bottom.js | 12 ++++++----- .../src/views/record/panels/default-side.js | 1 - client/src/views/record/panels/side.js | 15 +++++++------ 20 files changed, 104 insertions(+), 54 deletions(-) diff --git a/client/lib/bull.js b/client/lib/bull.js index 6bc34aee7a..a34b6a75f8 100644 --- a/client/lib/bull.js +++ b/client/lib/bull.js @@ -611,6 +611,8 @@ var Bull = Bull || {}; }, this); }, + handleDataBeforeRender: function (data) {}, + _getHtml: function (callback) { this._isBeingRendered = true; this.trigger("render", this); @@ -622,6 +624,7 @@ var Bull = Bull || {}; if (this.model || null) { data.model = this.model; } + this.handleDataBeforeRender(data); this._getTemplate(function (template) { var html = this._renderer.render(template, data); callback(html); diff --git a/client/modules/crm/res/templates/calendar/record/shared-options.tpl b/client/modules/crm/res/templates/calendar/record/shared-options.tpl index 3c6e169cce..271d8183d0 100644 --- a/client/modules/crm/res/templates/calendar/record/shared-options.tpl +++ b/client/modules/crm/res/templates/calendar/record/shared-options.tpl @@ -1,4 +1,4 @@
-
{{{users}}}
+
{{{usersField}}}
\ No newline at end of file diff --git a/client/res/layout-types/list-row-expanded.tpl b/client/res/layout-types/list-row-expanded.tpl index 67874b2031..94249004d1 100644 --- a/client/res/layout-types/list-row-expanded.tpl +++ b/client/res/layout-types/list-row-expanded.tpl @@ -7,7 +7,7 @@ <% _.each(layout.rows, function (row, key) { %>
<% _.each(row, function (defs, key) { %> - <% + <% var tag = 'tag' in defs ? defs.tag : false; if (tag) { print( '<' + tag); diff --git a/client/res/layout-types/list-row.tpl b/client/res/layout-types/list-row.tpl index f8cd2bc4a3..72924cb78f 100644 --- a/client/res/layout-types/list-row.tpl +++ b/client/res/layout-types/list-row.tpl @@ -13,7 +13,7 @@ align = defs.options.defs.align || false; } %> - > + > <% var tag = 'tag' in defs ? defs.tag : false; if (tag) { diff --git a/client/res/layout-types/record.tpl b/client/res/layout-types/record.tpl index f8be8842fd..645db444d7 100644 --- a/client/res/layout-types/record.tpl +++ b/client/res/layout-types/record.tpl @@ -67,15 +67,15 @@ spanClass = 'col-sm-12'; } %> -
- <% if (!cell.noLabel) { %>