fix setting parent_id, add approval status notices on top of post/show

This commit is contained in:
albert
2011-10-22 12:54:14 -04:00
parent b5cf9bf41f
commit 73a8c19c6e
8 changed files with 62 additions and 18 deletions

View File

@@ -1,6 +1,16 @@
<% if @post.errors.any? %>
Danbooru.error("Error: " + <%= @post.errors.full_messages.join("; ").to_json.html_safe %>);
<% else %>
$("#c-posts #approve").hide();
$("#c-posts #disapprove").hide();
$("#c-posts #flag").show();
$("#pending-approval-notice").hide();
$("#c-post-moderation #post-<%= @post.id %>").hide();
Danbooru.notice("Post was approved");
Danbooru.notice("Post was approved");
<% end %>

View File

@@ -1,12 +1,14 @@
<% if @post_disapproval.errors.any? %>
Danbooru.j_error("Error: " + "<%= j @post_disapproval.errors.full_messages.join("; ") %>");
Danbooru.error("Error: " + <%= @post_disapproval.errors.full_messages.join("; ").to_json.html_safe %>);
<% else %>
$("#c-posts #approve").hide();
$("#c-posts #disapprove").hide();
$("#pending-approval-notice").hide();
$("#c-post-moderation #post-<%= @post.id %>").hide();
Danbooru.notice("Post was disapproved");

View File

@@ -1,13 +1,36 @@
<% if (post.is_flagged? || post.is_deleted?) && post.flags.any? %>
<div class="ui-corner-all ui-state-error notice">
<span class="ui-icon ui-icon-alert"></span>
<div class="ui-corner-all ui-state-highlight notice">
This post has been flagged for deletion: <%= post_flag_reasons(post) %>
</div>
<% end %>
<% if post.is_pending? %>
<div class="ui-corner-all ui-state-highlight notice" id="pending-approval-notice">
This post is pending approval (<%= link_to "learn more", wiki_pages_path(:title => "help:post_moderation") %>)
<% if CurrentUser.is_janitor? && !post.disapproved_by?(CurrentUser.user) %>
<span class="quick-mod">
<%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :method => :post, :remote => true %>
| <%= link_to "Disapprove", moderator_post_disapproval_path(:post_id => post.id), :method => :post, :remote => true %>
</span>
<% end %>
</div>
<% end %>
<% if post.appeals.any? %>
<div class="ui-corner-all ui-state-highlight notice">
<span class="ui-icon ui-icon-info"></span>
This post has been appealed: <%= post_appeal_reasons(post) %>
</div>
<% end %>
<% if post.parent_id %>
<div class="ui-corner-all ui-state-highlight notice">
This post belongs to a <%= link_to "parent", post_path(post.parent_id) %> (<%= link_to "learn more", wiki_pages_path(:title => "help:post_relationships") %>)
</div>
<% end %>
<% if post.has_children? %>
<div class="ui-corner-all ui-state-highlight notice">
This post has <%= link_to "children", posts_path(:tags => "parent:#{post.id}") %> (<%= link_to "learn more", wiki_pages_path(:title => "help:post_relationships") %>)
</div>
<% end %>