<% if @post.is_flagged? %>
  <div class="status-notice">
    <%= t('.flagged.info', :user => @post.flag_detail.author, :reason => @post.flag_detail.reason) %>
    <% if @current_user.is_mod_or_higher? or (@post.flag_detail && @post.flag_detail.user_id == @current_user.id) then %>
    (<%= link_to_function t('.flagged.unflag'), "Post.unflag(#{ @post.id }, function() { window.location.reload(); });" %>)
    <% end %>
    <% if @current_user.is_janitor_or_higher? %>
      (<%= link_to_function t('.flagged.delete'), "Post.prompt_to_delete(#{@post.id});" %></li>)
    <% end %>
  </div>
<% elsif @post.is_pending? %>
  <div class="status-notice" id="pending-notice">
    <%= t('.pending.info') %>
    <% if @post.flag_detail %>
      <%= t('.reason') %>: <%= h @post.flag_detail.reason %>
    <% end %>
    <% if @current_user.is_janitor_or_higher? %>
      (<%= link_to_function t('.pending.approve._'), "if (confirm('#{t('.pending.approve.confirm')}')) {Post.approve(#{@post.id})}" %></li>)
      (<%= link_to_function t('.pending.delete'), "Post.prompt_to_delete(#{@post.id});" %></li>)
    <% end %>
  </div>
<% elsif @post.is_deleted? %>
  <div class="status-notice">
    <%= t('.deleted_info') %>
    <% if @post.flag_detail %>
      <% if @current_user.is_mod_or_higher? %>
        <%= t('.by') %>: <%= link_to h(@post.flag_detail.author), :controller => "user", :action => "show", :id => @post.flag_detail.user_id %>
      <% end %>

      <%= t('.reason') %>: <%= h @post.flag_detail.reason %>. MD5: <%= @post.md5 %>
    <% end %>
  </div>
<% end %>

<% if @post.is_held %>
  <div class="status-notice" id="held-notice">
    <%= t('.held.info') %>
    <% if @current_user.has_permission?(@post) %>
      (<%= link_to_function t('.held.activate'), "Post.activate_post(#{ @post.id });" %>)
    <% end %>
  </div>
<% end %>

<% if !@post.is_deleted? && @post.use_sample?(@current_user) && @post.can_be_seen_by?(@current_user) && !@post.tags.include?("dakimakura")%>
  <div class="status-notice" style="display: none;" id="resized_notice">
    <%= t('.resized.info_html', :larger => link_to(t('.resized.view_larger'), @post.get_file_jpeg[:url], :class => "highres-show")) %>
    <%= link_to_function t('.resized.hide'), "$('resized_notice').hide(); Cookie.put('hide_resized_notice', '1')" %>.
    <script type="text/javascript">
      if (Cookie.get("hide_resized_notice") != "1") {
        $("resized_notice").show()
      }
    </script>
  </div>
  <div class="status-notice" style="display: none;" id="samples_disabled">
    <%= t('.samples_disabled') %>
  </div>
<% end %>

<% if @post.parent_id %>
  <div class="status-notice">
    <%= t('.parent.has_parent_html', :parent => link_to(t('.parent.parent'), :action => "show", :id => @post.parent_id)) %><%
    %><% if @current_user.is_contributor_or_higher? %><span class="advanced-editing"> (<%= link_to_function t('.parent.make_parent'), "Post.reparent_post(#{@post.id}, #{@post.parent_id}, #{@post.get_parent.parent_id ? "true":"false"})" %>)</span><% end %>
  </div>
<% end %>
<% if @post.has_children? %>
  <% children = @post.children %>
  <div class="status-notice">
    <%= t('.parent.has_child_html', :child => link_to((children.length == 1 ? t('.parent.child') : t('.parent.children')), :action => "index", :tags => "parent:#{@post.id}")) %> (<%= t('.parent.child_post_html', :child => children.map { |child| link_to child.id, :action => :show, :id => child.id }.join(', ').html_safe) %>)
  </div>
<% end %>

<% @pool_posts.each do |pool_post| %>
  <%= render :partial => "post/show_partials/pool", :locals => { :pool => pool_post.pool, :pool_post => pool_post } %>
<% end %>
