mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Rename load
to loadUsers
which is what the method was actually
doing.
This commit is contained in:
parent
bd0c2a74fc
commit
325c2dfaea
@ -4,7 +4,7 @@ Discourse.AdminGroupsController = Ember.Controller.extend({
|
|||||||
actions: {
|
actions: {
|
||||||
edit: function(group){
|
edit: function(group){
|
||||||
this.get('model').select(group);
|
this.get('model').select(group);
|
||||||
group.load();
|
group.loadUsers();
|
||||||
},
|
},
|
||||||
|
|
||||||
refreshAutoGroups: function(){
|
refreshAutoGroups: function(){
|
||||||
@ -20,9 +20,8 @@ Discourse.AdminGroupsController = Ember.Controller.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
newGroup: function(){
|
newGroup: function(){
|
||||||
var group = Discourse.Group.create();
|
var group = Discourse.Group.create({ loadedUsers: true }),
|
||||||
group.set("loaded", true);
|
model = this.get("model");
|
||||||
var model = this.get("model");
|
|
||||||
model.addObject(group);
|
model.addObject(group);
|
||||||
model.select(group);
|
model.select(group);
|
||||||
},
|
},
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
<div class='content-editor'>
|
<div class='content-editor'>
|
||||||
{{#if model.active}}
|
{{#if model.active}}
|
||||||
{{#if model.active.loaded}}
|
{{#if model.active.loadedUsers}}
|
||||||
{{#with model.active}}
|
{{#with model.active}}
|
||||||
{{#if automatic}}
|
{{#if automatic}}
|
||||||
<h3>{{name}}</h3>
|
<h3>{{name}}</h3>
|
||||||
|
@ -21,7 +21,7 @@ var ALIAS_LEVELS = {
|
|||||||
];
|
];
|
||||||
|
|
||||||
Discourse.Group = Discourse.Model.extend({
|
Discourse.Group = Discourse.Model.extend({
|
||||||
loaded: false,
|
loadedUsers: false,
|
||||||
|
|
||||||
userCountDisplay: function(){
|
userCountDisplay: function(){
|
||||||
var c = this.get('user_count');
|
var c = this.get('user_count');
|
||||||
@ -31,19 +31,21 @@ Discourse.Group = Discourse.Model.extend({
|
|||||||
}
|
}
|
||||||
}.property('user_count'),
|
}.property('user_count'),
|
||||||
|
|
||||||
load: function() {
|
loadUsers: function() {
|
||||||
var id = this.get('id');
|
var id = this.get('id');
|
||||||
if(id && !this.get('loaded')) {
|
if(id && !this.get('loadedUsers')) {
|
||||||
var self = this;
|
var self = this;
|
||||||
Discourse.ajax('/admin/groups/' + this.get('id') + '/users').then(function(payload){
|
return Discourse.ajax('/admin/groups/' + this.get('id') + '/users').then(function(payload){
|
||||||
var users = Em.A();
|
var users = Em.A();
|
||||||
_.each(payload,function(user){
|
_.each(payload,function(user){
|
||||||
users.addObject(Discourse.User.create(user));
|
users.addObject(Discourse.User.create(user));
|
||||||
});
|
});
|
||||||
self.set('users', users);
|
self.set('users', users);
|
||||||
self.set('loaded', true);
|
self.set('loadedUsers', true);
|
||||||
|
return self;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
return Ember.RSVP.resolve(this);
|
||||||
},
|
},
|
||||||
|
|
||||||
usernames: function() {
|
usernames: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user