mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Ember Upgrade: 1.0
This commit is contained in:
@@ -8,62 +8,64 @@
|
||||
**/
|
||||
Discourse.AdminFlagsController = Ember.ArrayController.extend({
|
||||
|
||||
/**
|
||||
Clear all flags on a post
|
||||
actions: {
|
||||
/**
|
||||
Clear all flags on a post
|
||||
|
||||
@method clearFlags
|
||||
@param {Discourse.FlaggedPost} item The post whose flags we want to clear
|
||||
**/
|
||||
disagreeFlags: function(item) {
|
||||
var adminFlagsController = this;
|
||||
item.disagreeFlags().then((function() {
|
||||
adminFlagsController.removeObject(item);
|
||||
}), function() {
|
||||
bootbox.alert(I18n.t("admin.flags.error"));
|
||||
});
|
||||
},
|
||||
@method clearFlags
|
||||
@param {Discourse.FlaggedPost} item The post whose flags we want to clear
|
||||
**/
|
||||
disagreeFlags: function(item) {
|
||||
var adminFlagsController = this;
|
||||
item.disagreeFlags().then((function() {
|
||||
adminFlagsController.removeObject(item);
|
||||
}), function() {
|
||||
bootbox.alert(I18n.t("admin.flags.error"));
|
||||
});
|
||||
},
|
||||
|
||||
agreeFlags: function(item) {
|
||||
var adminFlagsController = this;
|
||||
item.agreeFlags().then((function() {
|
||||
adminFlagsController.removeObject(item);
|
||||
}), function() {
|
||||
bootbox.alert(I18n.t("admin.flags.error"));
|
||||
});
|
||||
},
|
||||
agreeFlags: function(item) {
|
||||
var adminFlagsController = this;
|
||||
item.agreeFlags().then((function() {
|
||||
adminFlagsController.removeObject(item);
|
||||
}), function() {
|
||||
bootbox.alert(I18n.t("admin.flags.error"));
|
||||
});
|
||||
},
|
||||
|
||||
deferFlags: function(item) {
|
||||
var adminFlagsController = this;
|
||||
item.deferFlags().then((function() {
|
||||
adminFlagsController.removeObject(item);
|
||||
}), function() {
|
||||
bootbox.alert(I18n.t("admin.flags.error"));
|
||||
});
|
||||
},
|
||||
deferFlags: function(item) {
|
||||
var adminFlagsController = this;
|
||||
item.deferFlags().then((function() {
|
||||
adminFlagsController.removeObject(item);
|
||||
}), function() {
|
||||
bootbox.alert(I18n.t("admin.flags.error"));
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
Deletes a post
|
||||
/**
|
||||
Deletes a post
|
||||
|
||||
@method deletePost
|
||||
@param {Discourse.FlaggedPost} item The post to delete
|
||||
**/
|
||||
deletePost: function(item) {
|
||||
var adminFlagsController = this;
|
||||
item.deletePost().then((function() {
|
||||
adminFlagsController.removeObject(item);
|
||||
}), function() {
|
||||
bootbox.alert(I18n.t("admin.flags.error"));
|
||||
});
|
||||
},
|
||||
@method deletePost
|
||||
@param {Discourse.FlaggedPost} item The post to delete
|
||||
**/
|
||||
deletePost: function(item) {
|
||||
var adminFlagsController = this;
|
||||
item.deletePost().then((function() {
|
||||
adminFlagsController.removeObject(item);
|
||||
}), function() {
|
||||
bootbox.alert(I18n.t("admin.flags.error"));
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
Deletes a user and all posts and topics created by that user.
|
||||
/**
|
||||
Deletes a user and all posts and topics created by that user.
|
||||
|
||||
@method deleteSpammer
|
||||
@param {Discourse.FlaggedPost} item The post to delete
|
||||
**/
|
||||
deleteSpammer: function(item) {
|
||||
item.get('user').deleteAsSpammer(function() { window.location.reload(); });
|
||||
@method deleteSpammer
|
||||
@param {Discourse.FlaggedPost} item The post to delete
|
||||
**/
|
||||
deleteSpammer: function(item) {
|
||||
item.get('user').deleteAsSpammer(function() { window.location.reload(); });
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user