move available groups loader into router
This commit is contained in:
parent
2435961b58
commit
5025e97712
|
@ -21,11 +21,6 @@ export default Ember.Component.extend({
|
||||||
).findBy("id", evt.removed.id)});
|
).findBy("id", evt.removed.id)});
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
Discourse.Group.findAll().then(function(groups){
|
|
||||||
this.set("available", groups.filterBy("automatic", false));
|
|
||||||
}.bind(this));
|
|
||||||
|
|
||||||
this._refreshOnReset();
|
this._refreshOnReset();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,11 @@ Discourse.AdminUserRoute = Discourse.Route.extend({
|
||||||
afterModel: function(adminUser) {
|
afterModel: function(adminUser) {
|
||||||
var controller = this.controllerFor('adminUser');
|
var controller = this.controllerFor('adminUser');
|
||||||
|
|
||||||
|
Discourse.Group.findAll().then(function(groups){
|
||||||
|
controller.set("availableGroups", groups.filterBy("automatic", false));
|
||||||
|
}.bind(this));
|
||||||
|
|
||||||
|
|
||||||
return adminUser.loadDetails().then(function () {
|
return adminUser.loadDetails().then(function () {
|
||||||
adminUser.setOriginalTrustLevel();
|
adminUser.setOriginalTrustLevel();
|
||||||
controller.set('model', adminUser);
|
controller.set('model', adminUser);
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
<div class='display-row'>
|
<div class='display-row'>
|
||||||
<div class='field'>{{i18n admin.groups.title}}</div>
|
<div class='field'>{{i18n admin.groups.title}}</div>
|
||||||
<div class='value'>
|
<div class='value'>
|
||||||
{{admin-group-selector selected=model.groups }}
|
{{admin-group-selector selected=model.groups available=availableGroups}}
|
||||||
</div>
|
</div>
|
||||||
<div class='controls'>
|
<div class='controls'>
|
||||||
{{#if custom_groups}}
|
{{#if custom_groups}}
|
||||||
|
|
Loading…
Reference in New Issue