mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-14 00:50:14 -04:00
Rename load
to loadUsers
which is what the method was actually
doing.
This commit is contained in:
parent
bd0c2a74fc
commit
325c2dfaea
3 changed files with 11 additions and 10 deletions
|
@ -4,7 +4,7 @@ Discourse.AdminGroupsController = Ember.Controller.extend({
|
|||
actions: {
|
||||
edit: function(group){
|
||||
this.get('model').select(group);
|
||||
group.load();
|
||||
group.loadUsers();
|
||||
},
|
||||
|
||||
refreshAutoGroups: function(){
|
||||
|
@ -20,9 +20,8 @@ Discourse.AdminGroupsController = Ember.Controller.extend({
|
|||
},
|
||||
|
||||
newGroup: function(){
|
||||
var group = Discourse.Group.create();
|
||||
group.set("loaded", true);
|
||||
var model = this.get("model");
|
||||
var group = Discourse.Group.create({ loadedUsers: true }),
|
||||
model = this.get("model");
|
||||
model.addObject(group);
|
||||
model.select(group);
|
||||
},
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<div class='content-editor'>
|
||||
{{#if model.active}}
|
||||
{{#if model.active.loaded}}
|
||||
{{#if model.active.loadedUsers}}
|
||||
{{#with model.active}}
|
||||
{{#if automatic}}
|
||||
<h3>{{name}}</h3>
|
||||
|
|
|
@ -21,7 +21,7 @@ var ALIAS_LEVELS = {
|
|||
];
|
||||
|
||||
Discourse.Group = Discourse.Model.extend({
|
||||
loaded: false,
|
||||
loadedUsers: false,
|
||||
|
||||
userCountDisplay: function(){
|
||||
var c = this.get('user_count');
|
||||
|
@ -31,19 +31,21 @@ Discourse.Group = Discourse.Model.extend({
|
|||
}
|
||||
}.property('user_count'),
|
||||
|
||||
load: function() {
|
||||
loadUsers: function() {
|
||||
var id = this.get('id');
|
||||
if(id && !this.get('loaded')) {
|
||||
if(id && !this.get('loadedUsers')) {
|
||||
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();
|
||||
_.each(payload,function(user){
|
||||
users.addObject(Discourse.User.create(user));
|
||||
});
|
||||
self.set('users', users);
|
||||
self.set('loaded', true);
|
||||
self.set('loadedUsers', true);
|
||||
return self;
|
||||
});
|
||||
}
|
||||
return Ember.RSVP.resolve(this);
|
||||
},
|
||||
|
||||
usernames: function() {
|
||||
|
|
Loading…
Reference in a new issue