Files
danbooru/app/views/moderator/post/disapprovals/index.html.erb
2019-08-29 20:44:27 -05:00

55 lines
2.6 KiB
Plaintext

<div id="c-moderator-post-disapprovals">
<div id="a-index">
<h1>Disapprovals</h1>
<%= simple_form_for(:search, url: moderator_post_disapprovals_path, method: :get, defaults: { required: false }, html: { class: "inline-form" }) do |f| %>
<%= f.input :user_name, label: "Creator", input_html: { value: params[:search][:user_name] } %>
<%= f.input :post_id, label: "Post ID", input_html: { value: params[:search][:post_id] } %>
<%= f.input :post_tags_match, label: "Tags", input_html: { value: params[:search][:post_tags_match], data: { autocomplete: "tag-query" } } %>
<%= f.input :message_matches, label: "Message", input_html: { value: params[:search][:message_matches] } %>
<%= f.input :reason, label: "Reason", collection: %w[breaks_rules disinterest poor_quality].map { |x| [x.humanize, x] }, include_blank: true, selected: params[:search][:reason] %>
<%= f.input :has_message, label: "Has Message?", collection: %w[Yes No], include_blank: true, selected: params[:search][:has_message] %>
<%= f.input :order, collection: [["ID", "id_desc"], ["Post ID", "post_id_desc"]], selected: params[:search][:order] %>
<%= f.submit "Search" %>
<% end %>
<table class="striped autofit" width="100%">
<thead>
<tr>
<th>Post</th>
<th>Message</th>
<th>Reason</th>
<th>Created</th>
</tr>
</thead>
<tbody>
<% @post_disapprovals.each do |post_disapproval| %>
<tr>
<td>
<%= link_to "post ##{post_disapproval.post_id}", post_path(post_disapproval.post_id) %>
<%= link_to "»", moderator_post_disapprovals_path(search: params[:search].merge(post_id: post_disapproval.post_id)) %>
</td>
<td class="col-expand"><%= format_text(post_disapproval.message) %></td>
<td>
<%= link_to post_disapproval.reason.humanize, moderator_post_disapprovals_path(search: params[:search].merge(reason: post_disapproval.reason)) %>
</td>
<td>
<%= link_to_user post_disapproval.user %>
<%= link_to "»", moderator_post_disapprovals_path(search: params[:search].merge(creator_name: post_disapproval.user&.name)) %>
<p>
<%= compact_time(post_disapproval.updated_at) %>
</p>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= numbered_paginator(@post_disapprovals) %>
</div>
</div>
<% content_for(:page_title) do %>
Post Disapprovals - <%= Danbooru.config.app_name %>
<% end %>