js: clean up notice/error messaging.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<% if @approval.errors.any? %>
|
||||
$(window).trigger("danbooru:error", "Error: " + <%= @approval.errors.full_messages.join("; ").to_json.html_safe %>);
|
||||
Danbooru.error("Error: " + <%= @approval.errors.full_messages.join("; ").to_json.html_safe %>);
|
||||
<% else %>
|
||||
if ($("#c-posts #a-show").length) {
|
||||
location.reload();
|
||||
} else if ($("#c-moderator-post-queues").length) {
|
||||
$("#c-moderator-post-queues #post-<%= @approval.post.id %>").hide();
|
||||
$(window).trigger("danbooru:modqueue_increment_processed");
|
||||
$(window).trigger("danbooru:notice", "Post was approved");
|
||||
Danbooru.notice("Post was approved");
|
||||
}
|
||||
<% end %>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<% if @post_disapproval.errors.any? %>
|
||||
$(window).trigger("danbooru:error", "Error: " + <%= @post_disapproval.errors.full_messages.join("; ").to_json.html_safe %>);
|
||||
Danbooru.error("Error: " + <%= @post_disapproval.errors.full_messages.join("; ").to_json.html_safe %>);
|
||||
<% else %>
|
||||
if ($("#c-posts #a-show").length) {
|
||||
location.reload();
|
||||
} else if ($("#c-moderator-post-queues").length) {
|
||||
$("#c-moderator-post-queues #post-<%= @post_disapproval.post.id %>").hide();
|
||||
$(window).trigger("danbooru:modqueue_increment_processed");
|
||||
$(window).trigger("danbooru:notice", "Post was hidden");
|
||||
Danbooru.notice("Post was hidden");
|
||||
}
|
||||
<% end %>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<% if @post.errors.any? %>
|
||||
$(window).trigger("danbooru:error", "<%= j @post.errors.full_messages.join('; ') %>");
|
||||
Danbooru.error("<%= j @post.errors.full_messages.join('; ') %>");
|
||||
<% elsif @error %>
|
||||
$(window).trigger("danbooru:error", "<%= j @error.to_s %>");
|
||||
Danbooru.error("<%= j @error.to_s %>");
|
||||
<% else %>
|
||||
$(window).trigger("danbooru:notice", "Post was permanently deleted");
|
||||
Danbooru.notice("Post was permanently deleted");
|
||||
<% end %>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
$("#c-posts #delete").show();
|
||||
$("#c-posts #undelete").hide();
|
||||
$(window).trigger("danbooru:notice", "Post was undeleted");
|
||||
Danbooru.notice("Post was undeleted");
|
||||
|
||||
Reference in New Issue
Block a user