mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 10:08:20 -05:00
41 lines
996 B
JavaScript
41 lines
996 B
JavaScript
(function() {
|
|
|
|
/**
|
|
This controller supports the interface for dealing with flags in the admin section.
|
|
|
|
@class AdminFlagsController
|
|
@extends Ember.Controller
|
|
@namespace Discourse
|
|
@module Discourse
|
|
**/
|
|
window.Discourse.AdminFlagsController = Ember.Controller.extend({
|
|
|
|
clearFlags: function(item) {
|
|
var _this = this;
|
|
item.clearFlags().then((function() {
|
|
_this.content.removeObject(item);
|
|
}), (function() {
|
|
bootbox.alert("something went wrong");
|
|
}));
|
|
},
|
|
|
|
deletePost: function(item) {
|
|
var _this = this;
|
|
item.deletePost().then((function() {
|
|
_this.content.removeObject(item);
|
|
}), (function() {
|
|
bootbox.alert("something went wrong");
|
|
}));
|
|
},
|
|
|
|
adminOldFlagsView: (function() {
|
|
return this.query === 'old';
|
|
}).property('query'),
|
|
|
|
adminActiveFlagsView: (function() {
|
|
return this.query === 'active';
|
|
}).property('query')
|
|
|
|
});
|
|
|
|
}).call(this);
|