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,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 %>