show total

This commit is contained in:
Yuri Kuznetsov
2014-07-30 11:43:14 +03:00
parent b5e015e9c9
commit acb6e245a2
5 changed files with 26 additions and 4 deletions
@@ -31,7 +31,12 @@
{{#unless paginationEnabled}}
{{#if showMoreEnabled}}
<div class="show-more{{#unless showMoreActive}} hide{{/unless}}">
<a type="button" href="javascript:" class="btn btn-default btn-block" data-action="showMore">{{translate 'Show more'}}</a>
<a type="button" href="javascript:" class="btn btn-default btn-block" data-action="showMore">
{{#if showTotalCount}}
<div class="pull-right text-muted">{{totalCount}}</div>
{{/if}}
<span>{{translate 'Show more'}}</span>
</a>
</div>
{{/if}}
{{/unless}}
@@ -56,7 +56,12 @@
{{#unless paginationEnabled}}
{{#if showMoreEnabled}}
<div class="show-more{{#unless showMoreActive}} hide{{/unless}}">
<a type="button" href="javascript:" class="btn btn-default btn-block" data-action="showMore">{{translate 'Show more'}}</a>
<a type="button" href="javascript:" class="btn btn-default btn-block" data-action="showMore">
{{#if showTotalCount}}
<div class="pull-right text-muted">{{totalCount}}</div>
{{/if}}
<span>{{translate 'Show more'}}</span>
</a>
</div>
{{/if}}
{{/unless}}
@@ -39,6 +39,7 @@ Espo.define('Views.Notifications.Panel', 'View', function (Dep) {
this.createView('list', 'Record.ListExpanded', {
el: this.options.el + ' .list-container',
collection: this.collection,
showTotalCount: false,
listLayout: {
rows: [
[
+11 -2
View File
@@ -51,6 +51,8 @@ Espo.define('Views.Record.List', 'View', function (Dep) {
_internalLayoutType: 'list-row',
listContainerEl: '.list > table > tbody',
showTotalCount: true,
events: {
'click a.link': function (e) {
@@ -266,11 +268,14 @@ Espo.define('Views.Record.List', 'View', function (Dep) {
paginationBottom: paginationBottom,
showMoreActive: this.collection.total > this.collection.length,
showMoreEnabled: this.showMore,
checkboxes: this.checkboxes,
showTotalCount: this.showTotalCount,
totalCount: this.collection.total,
checkboxes: this.checkboxes,
actions: this._getActions(),
rows: this.rows,
topBar: paginationTop || this.checkboxes,
bottomBar: paginationBottom,
bottomBar: paginationBottom,
};
},
@@ -337,6 +342,10 @@ Espo.define('Views.Record.List', 'View', function (Dep) {
};
}
if ('showTotalCount' in this.options) {
this.showTotalCount = this.options.showTotalCount;
}
if (!this.getConfig().get('disableExport') || this.getUser().get('isAdmin')) {
this.actions.push({
name: 'export',
+2
View File
@@ -24,6 +24,8 @@ Espo.define('Views.Stream.List', 'Views.Record.ListExpanded', function (Dep) {
return Dep.extend({
type: 'listStream',
showTotalCount: false,
buildRow: function (i, model, callback) {
var key = 'row-' + model.id;