From a8b3010617acbb1016db0ffe44188d0f836f2d69 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 14 Sep 2015 15:54:34 -0400 Subject: [PATCH] FIX: Pagination was broken for groups --- app/assets/javascripts/admin/controllers/admin-group.js.es6 | 4 ++-- app/assets/javascripts/admin/templates/group.hbs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/admin/controllers/admin-group.js.es6 b/app/assets/javascripts/admin/controllers/admin-group.js.es6 index f16151ed29e..2ee95299a18 100644 --- a/app/assets/javascripts/admin/controllers/admin-group.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-group.js.es6 @@ -39,7 +39,7 @@ export default Ember.Controller.extend({ if (this.get("showingLast")) { return; } const group = this.get("model"), - offset = Math.min(group.get("offset") + group.get("model.limit"), group.get("user_count")); + offset = Math.min(group.get("offset") + group.get("limit"), group.get("user_count")); group.set("offset", offset); @@ -50,7 +50,7 @@ export default Ember.Controller.extend({ if (this.get("showingFirst")) { return; } const group = this.get("model"), - offset = Math.max(group.get("offset") - group.get("model.limit"), 0); + offset = Math.max(group.get("offset") - group.get("limit"), 0); group.set("offset", offset); diff --git a/app/assets/javascripts/admin/templates/group.hbs b/app/assets/javascripts/admin/templates/group.hbs index 3da80d9af7d..ac1f979691c 100644 --- a/app/assets/javascripts/admin/templates/group.hbs +++ b/app/assets/javascripts/admin/templates/group.hbs @@ -13,9 +13,9 @@
- {{fa-icon "fast-backward"}} + {{currentPage}}/{{totalPages}} - {{fa-icon "fast-forward"}} +
{{#each model.members as |member|}} @@ -28,7 +28,7 @@
{{user-selector usernames=model.usernames placeholderKey="admin.groups.selector_placeholder" id="user-selector"}} - + {{d-button action="addMembers" class="add" icon="plus" label="admin.groups.add"}}
{{/unless}} {{/if}}