add ban to post mode menu

This commit is contained in:
Albert Yi
2016-12-09 11:56:25 -08:00
parent dfb7a000a5
commit 2af622e7a7
6 changed files with 33 additions and 2 deletions

View File

@@ -164,6 +164,8 @@
Danbooru.Post.update(post_id, {"post[is_note_locked]": "1"});
} else if (s === 'approve') {
Danbooru.Post.approve(post_id);
} else if (s === 'ban') {
Danbooru.Post.ban(post_id);
} else if (s === "tag-script") {
var current_script_id = Danbooru.Cookie.get("current_tag_script_id");
var tag_script = Danbooru.Cookie.get("tag-script-" + current_script_id);

View File

@@ -502,7 +502,22 @@
error: function(data) {
Danbooru.Post.notice_update("dec");
Danbooru.error('There was an error updating <a href="/posts/' + post_id + '">post #' + post_id + '</a>');
$("#post_" + post_id).effect("shake", {distance: 5, times: 1}, 100);
}
});
}
Danbooru.Post.ban = function(post_id) {
$.ajax({
type: "POST",
url: "/moderator/post/posts/" + post_id + "/ban.js",
data: {
commit: "Ban"
},
success: function(data) {
$("#post_" + post_id).remove();
},
error: function(data) {
Danbooru.error('There was an error updating <a href="/posts/' + post_id + '">post #' + post_id + '</a>');
}
});
}