2013-02-20 13:15:50 -05:00
|
|
|
(function() {
|
|
|
|
|
|
|
|
window.Discourse.AdminFlagsController = Ember.Controller.extend({
|
2013-02-21 12:54:40 -05:00
|
|
|
|
2013-02-20 13:15:50 -05:00
|
|
|
clearFlags: function(item) {
|
|
|
|
var _this = this;
|
|
|
|
return item.clearFlags().then((function() {
|
|
|
|
return _this.content.removeObject(item);
|
|
|
|
}), (function() {
|
|
|
|
return bootbox.alert("something went wrong");
|
|
|
|
}));
|
|
|
|
},
|
2013-02-21 12:54:40 -05:00
|
|
|
|
2013-02-20 13:15:50 -05:00
|
|
|
deletePost: function(item) {
|
|
|
|
var _this = this;
|
|
|
|
return item.deletePost().then((function() {
|
|
|
|
return _this.content.removeObject(item);
|
|
|
|
}), (function() {
|
|
|
|
return bootbox.alert("something went wrong");
|
|
|
|
}));
|
|
|
|
},
|
2013-02-21 12:54:40 -05:00
|
|
|
|
2013-02-20 13:15:50 -05:00
|
|
|
adminOldFlagsView: (function() {
|
|
|
|
return this.query === 'old';
|
|
|
|
}).property('query'),
|
2013-02-21 12:54:40 -05:00
|
|
|
|
2013-02-20 13:15:50 -05:00
|
|
|
adminActiveFlagsView: (function() {
|
|
|
|
return this.query === 'active';
|
|
|
|
}).property('query')
|
2013-02-21 12:54:40 -05:00
|
|
|
|
2013-02-20 13:15:50 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
}).call(this);
|