mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-04-29 07:24:09 -04:00
FIX: Pagination was broken for groups
This commit is contained in:
parent
edf54979e4
commit
a8b3010617
2 changed files with 5 additions and 5 deletions
app/assets/javascripts/admin
|
@ -39,7 +39,7 @@ export default Ember.Controller.extend({
|
||||||
if (this.get("showingLast")) { return; }
|
if (this.get("showingLast")) { return; }
|
||||||
|
|
||||||
const group = this.get("model"),
|
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);
|
group.set("offset", offset);
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ export default Ember.Controller.extend({
|
||||||
if (this.get("showingFirst")) { return; }
|
if (this.get("showingFirst")) { return; }
|
||||||
|
|
||||||
const group = this.get("model"),
|
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);
|
group.set("offset", offset);
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
<div>
|
<div>
|
||||||
<label>{{i18n 'admin.groups.group_members'}} ({{model.user_count}})</label>
|
<label>{{i18n 'admin.groups.group_members'}} ({{model.user_count}})</label>
|
||||||
<div>
|
<div>
|
||||||
<a {{bind-attr class=":previous showingFirst:disabled"}} {{action "previous"}}>{{fa-icon "fast-backward"}}</a>
|
<a class="previous {{if showingFirst 'disabled'}}" {{action "previous"}}>{{fa-icon "fast-backward"}}</a>
|
||||||
{{currentPage}}/{{totalPages}}
|
{{currentPage}}/{{totalPages}}
|
||||||
<a {{bind-attr class=":next showingLast:disabled"}} {{action "next"}}>{{fa-icon "fast-forward"}}</a>
|
<a class="next {{if showingLast 'disabled'}}" {{action "next"}}>{{fa-icon "fast-forward"}}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="ac-wrap clearfix">
|
<div class="ac-wrap clearfix">
|
||||||
{{#each model.members as |member|}}
|
{{#each model.members as |member|}}
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
<div>
|
<div>
|
||||||
<label for="user-selector">{{i18n 'admin.groups.add_members'}}</label>
|
<label for="user-selector">{{i18n 'admin.groups.add_members'}}</label>
|
||||||
{{user-selector usernames=model.usernames placeholderKey="admin.groups.selector_placeholder" id="user-selector"}}
|
{{user-selector usernames=model.usernames placeholderKey="admin.groups.selector_placeholder" id="user-selector"}}
|
||||||
<button {{action "addMembers"}} class='btn add'>{{fa-icon "plus"}} {{i18n 'admin.groups.add'}}</button>
|
{{d-button action="addMembers" class="add" icon="plus" label="admin.groups.add"}}
|
||||||
</div>
|
</div>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue