<div id="c-moderator-post-queues">
  <div id="a-show">
    <div id="search">
      <%= form_tag(moderator_post_queue_path, :method => :get) do %>
        <%= text_field_tag "query", params[:query], :size => 40 %>
        <%= submit_tag "Search" %>
      <% end %>
    </div>

    <div>
      <h1>Moderation Queue</h1>

      <div id="moderation-guideline">
        <h1>Deletion Guidelines</h1>
        <p>
          As a general rule, you should only approve of posts that you personally like. Posts that are not approved in three days will be automatically deleted. Posts with score -3 or lower are marked red. Posts with score 3 or higher are marked green. Posts with the duplicate tag are marked in yellow.
          <% if params[:hidden] %>
            <%= link_to "View pending posts", moderator_post_queue_path(:query => params[:query], :hidden => nil) %>.
          <% else %>
            <%= link_to "View hidden posts", moderator_post_queue_path(:query => params[:query], :hidden => true) %>.
          <% end %>
        </p>

        <p><%= button_tag "Approve all", :id => "approve-all-button" %><%= button_tag "Hide all", :id => "hide-all-button" %></p>
      </div>

      <% @posts.each do |post| %>
        <article class="post" id="post-<%= post.id %>" data-score="<%= post.score %>" data-has-children="<%= post.has_children? %>" data-has-dup="<%= post.has_dup_tag? %>">
          <aside>
            <%= link_to(image_tag(post.preview_file_url), post_path(post), :target => "_blank") %>
          </aside>

          <section>
            <ul>
              <li><h2><%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :remote => true, :method => :post, :class => "approve-link" %> | <%= link_to "Hide", moderator_post_disapproval_path(:post_id => post.id), :remote => true, :method => :post, :class => 'disapprove-link' %></h2></li>
              <li><strong>Rating</strong>: <%= post.pretty_rating %></li>
              <li><strong>Score</strong>: <%= post.score %></li>
              <li>
                <strong>Size:</strong>
                <%= number_to_human_size(post.file_size) %>
                <% if post.is_image? %>
                  (<%= post.image_width %>x<%= post.image_height %>)
                <% end %>
              </li>
              <li><strong>Uploader</strong>: <%= link_to(post.uploader.name, user_path(post.uploader_id)) %> <%= time_ago_in_words_tagged(post.created_at) %></li>
              <% if post.is_flagged? %>
                <li><strong>Flagged</strong>: <%= post_flag_reasons(post) %></li>
              <% end %>
              <% if (post.is_flagged? || post.is_deleted?) && post.appeals.any? %>
                <li><strong>Appeals</strong>: <%= post_appeal_reasons(post) %></li>
              <% end %>
              <li><strong>Hidden</strong>: <%= post.disapprovals.count %></li>
              <li><strong>Tags</strong>: <%= post.tag_string %></li>
            </ul>
          </section>
        </article>
      <% end %>
    </div>

    <%= numbered_paginator(@posts) %>
  </div>
</div>

<%= render "posts/partials/common/secondary_links" %>

<% content_for(:page_title) do %>
  Mod Queue - <%= Danbooru.config.app_name %>
<% end %>
