From ca5dfd851dadfa2769676b6db61484872da8b48b Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 14 Jan 2015 15:12:37 +0200 Subject: [PATCH] customLabels for list --- frontend/client/res/templates/record/list.tpl | 24 +++++++++++++------ frontend/client/src/views/record/list.js | 5 +++- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/frontend/client/res/templates/record/list.tpl b/frontend/client/res/templates/record/list.tpl index d8a75eb1e8..7cdbacf220 100644 --- a/frontend/client/res/templates/record/list.tpl +++ b/frontend/client/res/templates/record/list.tpl @@ -37,30 +37,40 @@ {{#each headerDefs}} {{#if this.sortable}} - {{translate this.name scope=../../../collection.name category='fields'}} - {{#if this.sorted}}{{#if this.asc}}{{else}}{{/if}}{{/if}} + + {{#if this.customLabel}} + {{this.customLabel}} + {{else}} + {{translate this.name scope=../../../collection.name category='fields'}} + {{/if}} + + {{#if this.sorted}}{{#if this.asc}}{{else}}{{/if}}{{/if}} {{else}} - {{translate this.name scope=../../../collection.name category='fields'}} + {{#if this.customLabel}} + {{this.customLabel}} + {{else}} + {{translate this.name scope=../../../collection.name category='fields'}} + {{/if}} {{/if}} {{/each}} - {{/if}} + {{/if}} {{#each rows}} - {{{var this ../this}}} + {{{var this ../this}}} {{/each}} {{#unless paginationEnabled}} - {{#if showMoreEnabled}} + {{#if showMoreEnabled}}
{{#if showCount}}
{{moreCount}}
{{/if}} - {{translate 'Show more'}} + {{translate 'Show more'}}
{{/if}} diff --git a/frontend/client/src/views/record/list.js b/frontend/client/src/views/record/list.js index f388d7d07c..ae525fd613 100644 --- a/frontend/client/src/views/record/list.js +++ b/frontend/client/src/views/record/list.js @@ -441,8 +441,11 @@ Espo.define('Views.Record.List', 'View', function (Dep) { name: this.listLayout[i].name, sortable: !(this.listLayout[i].notSortable || false), width: ('width' in this.listLayout[i]) ? this.listLayout[i].width : false, - align: ('align' in this.listLayout[i]) ? this.listLayout[i].align : false + align: ('align' in this.listLayout[i]) ? this.listLayout[i].align : false, }; + if ('customLabel' in this.listLayout[i]) { + item.customLabel = this.listLayout[i].customLabel; + } if (item.sortable) { item.sorted = this.collection.sortBy === this.listLayout[i].name; if (item.sorted) {