Ember Upgrade: 1.0

This commit is contained in:
Robin Ward
2013-09-16 14:08:55 -04:00
parent 01075c5e7a
commit be0ce08cc2
110 changed files with 19597 additions and 8477 deletions

View File

@ -1,49 +1,51 @@
Discourse.AdminGroupsController = Ember.Controller.extend({
itemController: 'adminGroup',
edit: function(group){
this.get('model').select(group);
group.load();
},
actions: {
edit: function(group){
this.get('model').select(group);
group.load();
},
refreshAutoGroups: function(){
var controller = this;
refreshAutoGroups: function(){
var self = this;
this.set('refreshingAutoGroups', true);
Discourse.ajax('/admin/groups/refresh_automatic_groups', {type: 'POST'})
.then(function() {
controller.set('model', Discourse.Group.findAll());
controller.set('refreshingAutoGroups', false);
});
},
self.set('refreshingAutoGroups', true);
Discourse.ajax('/admin/groups/refresh_automatic_groups', {type: 'POST'}).then(function() {
self.set('model', Discourse.Group.findAll());
self.set('refreshingAutoGroups', false);
});
},
newGroup: function(){
var group = Discourse.Group.create();
group.set("loaded", true);
var model = this.get("model");
model.addObject(group);
model.select(group);
},
newGroup: function(){
var group = Discourse.Group.create();
group.set("loaded", true);
var model = this.get("model");
model.addObject(group);
model.select(group);
},
save: function(group){
if(!group.get("id")){
group.create();
} else {
group.save();
}
},
destroy: function(group){
var _this = this;
return bootbox.confirm(I18n.t("admin.groups.delete_confirm"), I18n.t("no_value"), I18n.t("yes_value"), function(result) {
if (result) {
group.destroy().then(function(deleted) {
if (deleted) {
_this.get("model").removeObject(group);
}
});
save: function(group){
if(!group.get("id")){
group.create();
} else {
group.save();
}
});
},
destroy: function(group){
var self = this;
return bootbox.confirm(I18n.t("admin.groups.delete_confirm"), I18n.t("no_value"), I18n.t("yes_value"), function(result) {
if (result) {
group.destroy().then(function(deleted) {
if (deleted) {
self.get("model").removeObject(group);
}
});
}
});
}
}
});