fixes #653
This commit is contained in:
@@ -109,6 +109,8 @@
|
||||
Danbooru.Post.update(post_id, {"post[is_rating_locked]": "1"});
|
||||
} else if (s === 'lock-note') {
|
||||
Danbooru.Post.update(post_id, {"post[is_note_locked]": "1"});
|
||||
} else if (s === 'approve') {
|
||||
Danbooru.Post.approve(post_id);
|
||||
} else if (s === "apply-tag-script") {
|
||||
var tag_script = Danbooru.Cookie.get("tag-script");
|
||||
Danbooru.TagScript.run(post_id, tag_script);
|
||||
|
||||
@@ -308,16 +308,33 @@
|
||||
complete: function() {
|
||||
Danbooru.Post.notice_update("dec");
|
||||
},
|
||||
success: function(data, status, xhr) {
|
||||
success: function(data) {
|
||||
Danbooru.Post.update_data(data);
|
||||
|
||||
},
|
||||
error: function(data, status, xhr) {
|
||||
error: function(data) {
|
||||
Danbooru.notice("Error: " + data.reason);
|
||||
$("#post_" + data.id).effect("shake", {"distance": 20}, "fast");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Danbooru.Post.approve = function(post_id) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/moderator/post/approval.json",
|
||||
data: {"post_id": post_id},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if (!data.success) {
|
||||
Danbooru.error("Error: " + data.reason);
|
||||
} else {
|
||||
var $post = $("#post_" + post_id);
|
||||
$post.data("flags", $post.data("flags").replace(/pending/, ""));
|
||||
$post.removeClass("post-status-pending");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Danbooru.Post.place_jlist_ads = function() {
|
||||
var jlist = $("#jlist-rss-ads-for-show");
|
||||
|
||||
1
app/views/moderator/post/approvals/create.json.erb
Normal file
1
app/views/moderator/post/approvals/create.json.erb
Normal file
@@ -0,0 +1 @@
|
||||
{"success": <%= @post.errors.empty? %>, "reason": <%= raw @post.errors.full_messages.join("; ").to_json %>}
|
||||
@@ -14,6 +14,9 @@
|
||||
<option value="vote-down">Vote down</option>
|
||||
<option value="lock-rating">Lock rating</option>
|
||||
<option value="lock-note">Lock notes</option>
|
||||
<% if CurrentUser.is_janitor? %>
|
||||
<option value="approve">Approve</option>
|
||||
<% end %>
|
||||
<option value="edit-tag-script">Edit tag script</option>
|
||||
<option value="apply-tag-script">Apply tag script</option>
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user