customLabels for list

This commit is contained in:
yuri
2015-01-14 15:12:37 +02:00
parent ff5616c399
commit ca5dfd851d
2 changed files with 21 additions and 8 deletions
+17 -7
View File
@@ -37,30 +37,40 @@
{{#each headerDefs}}
<th {{#if width}} width="{{width}}%"{{/if}}{{#if align}} style="text-align: {{align}};"{{/if}}>
{{#if this.sortable}}
<a href="javascript:" class="sort" data-name="{{this.name}}">{{translate this.name scope=../../../collection.name category='fields'}}</a>
{{#if this.sorted}}{{#if this.asc}}<span class="caret"></span>{{else}}<span class="caret-up"></span>{{/if}}{{/if}}
<a href="javascript:" class="sort" data-name="{{this.name}}">
{{#if this.customLabel}}
{{this.customLabel}}
{{else}}
{{translate this.name scope=../../../collection.name category='fields'}}
{{/if}}
</a>
{{#if this.sorted}}{{#if this.asc}}<span class="caret"></span>{{else}}<span class="caret-up"></span>{{/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}}
</th>
{{/each}}
</tr>
</thead>
{{/if}}
{{/if}}
<tbody>
{{#each rows}}
{{{var this ../this}}}
{{{var this ../this}}}
{{/each}}
</tbody>
</table>
{{#unless paginationEnabled}}
{{#if showMoreEnabled}}
{{#if showMoreEnabled}}
<div class="show-more{{#unless showMoreActive}} hide{{/unless}}">
<a type="button" href="javascript:" class="btn btn-default btn-block" data-action="showMore">
{{#if showCount}}
<div class="pull-right text-muted more-count">{{moreCount}}</div>
{{/if}}
<span>{{translate 'Show more'}}</span>
<span>{{translate 'Show more'}}</span>
</a>
</div>
{{/if}}
+4 -1
View File
@@ -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) {