<% if post.is_flagged? && !post.is_deleted? && post.flags.any? %>
  <div class="ui-corner-all ui-state-highlight notice notice-flagged">
    <p>This post was flagged for review (<%= link_to "learn more", wiki_pages_path(:title => "howto:flag") %>): </p>

    <%= post_flag_reasons(post) %>
  </div>
<% end %>

<% if post.is_banned? %>
  <div class="ui-corner-all ui-state-highlight notice notice-deleted">
    The artist requested removal of this page
  </div>
<% end %>

<% if post.is_deleted? %>
  <div class="ui-corner-all ui-state-highlight notice notice-deleted">
    <% if post.flags.any? %>
      <p>This post was deleted for the following reasons: </p>
      <%= post_flag_reasons(post) %>
    <% else %>
      <p>This post was deleted</p>
    <% end %>

    <%= render "post_disapprovals/counts", :disapprovals => post.disapprovals, :post => post %>

    <% if CurrentUser.id == post.uploader_id && Danbooru.config.upload_feedback_topic.present? %>
      <p>If you don't understand why your uploads keep getting deleted, you should ask on the <%= link_to "forum", forum_topic_path(Danbooru.config.upload_feedback_topic) %> for advice.</p>
    <% end %>
  </div>
<% end %>

<% if post.is_pending? || post.is_flagged? %>
  <div class="ui-corner-all ui-state-highlight notice notice-pending" id="pending-approval-notice">
    <% if post.is_pending? %>
      This post is pending approval. 
      (<%= link_to "learn more", wiki_pages_path(:title => "about:mod_queue") %>)
    <% else %>
      This post was flagged and is pending approval (<%= link_to "learn more", wiki_pages_path(:title => "about:mod_queue") %>)
    <% end %>

    <%= render "post_disapprovals/counts", :disapprovals => post.disapprovals, :post => post %>

    <% if CurrentUser.can_approve_posts? && !post.disapproved_by?(CurrentUser.user) %>
      <div class="quick-mod">
        <% unless post.is_status_locked? %>
          <%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :id => "quick-mod-approve", :method => :post, :remote => true, :class => "btn" %> |
        <% end %>
        <%= link_to "Breaks Rules", moderator_post_disapproval_path(:post_id => post.id, :reason => "breaks_rules"), :method => :post, :remote => true, :class => "btn" %> |
        <%= link_to "Poor Quality", moderator_post_disapproval_path(:post_id => post.id, :reason => "poor_quality"), :method => :post, :remote => true, :class => "btn" %> |
        <%= link_to "No Interest", moderator_post_disapproval_path(:post_id => post.id, :reason => "disinterest"), :method => :post, :remote => true, :class => "btn" %> |
        <%= link_to "Detailed Rejection", "#", "data-post-id" => post.id, :class => "detailed-rejection-link btn" %>

      </div>
    <% end %>
  </div>
<% end %>

<% if (post.is_flagged? || post.is_deleted?) && post.appeals.any? %>
  <div class="ui-corner-all ui-state-highlight notice notice-appealed">
    <p>This post was appealed:</p>
    <%= post_appeal_reasons(post) %>
  </div>
<% end %>

<% if post.parent_id && post.parent_exists? %>
  <div class="ui-corner-all ui-state-highlight notice notice-child">
    <%= has_parent_message(post, @parent_post_set) %>
    <div id="has-parent-relationship-preview"><%= @parent_post_set.presenter.post_previews_html(self) %></div>
  </div>
<% end %>

<% if post.has_visible_children? %>
  <div class="ui-corner-all ui-state-highlight notice notice-parent">
    <%= has_children_message(post, @children_post_set) %>
    <div id="has-children-relationship-preview"><%= @children_post_set.presenter.post_previews_html(self) %></div>
  </div>
<% end %>

<% if post.visible? && post.has_large? && !post.is_ugoira? %>
  <div class="ui-corner-all ui-state-highlight notice notice-resized" id="image-resize-notice" style="<%= CurrentUser.default_image_size == "original" ? "display: none;" : "" %>">
    <span>Resized to <%= number_to_percentage post.resize_percentage.floor, :precision => 0 %> of original (<%= link_to "view original", post.file_url, :id => "image-resize-link" %>)</span>
    <span style="display: none;">Loading...</span>
  </div>
<% end %>

<%= render "post_disapprovals/detailed_rejection_dialog" %>
