Merge pull request #4051 from r888888888/add-post-disapprovals-index
Add post disapprovals index
This commit is contained in:
@@ -11,6 +11,10 @@ module Moderator
|
|||||||
respond_with(@post_disapproval)
|
respond_with(@post_disapproval)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def index
|
||||||
|
@post_disapprovals = PostDisapproval.paginate(params[:page])
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def post_disapproval_params
|
def post_disapproval_params
|
||||||
|
|||||||
30
app/views/moderator/post/disapprovals/index.html.erb
Normal file
30
app/views/moderator/post/disapprovals/index.html.erb
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<div id="c-moderator-post-disapprovals">
|
||||||
|
<div id="a-index">
|
||||||
|
<h1>Disapprovals</h1>
|
||||||
|
|
||||||
|
<table class="striped" width="100%">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Post</th>
|
||||||
|
<th>Reason</th>
|
||||||
|
<th>Creator</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% @post_disapprovals.each do |post_disapproval| %>
|
||||||
|
<tr>
|
||||||
|
<td><%= link_to post_disapproval.post_id, post_path(post_disapproval.post_id) %></td>
|
||||||
|
<td><%= post_disapproval.reason %>: <%= post_disapproval.message %></td>
|
||||||
|
<td><%= post_disapproval.user.name %></td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<%= numbered_paginator(@post_disapprovals) %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% content_for(:page_title) do %>
|
||||||
|
Post Disapprovals - <%= Danbooru.config.app_name %>
|
||||||
|
<% end %>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<div class="quick-mod">
|
<div class="quick-mod">
|
||||||
<%= link_to_if post.is_approvable?, "Approve", moderator_post_approval_path(post_id: post.id), method: :post, remote: true, class: "approve-link btn" %> |
|
<%= link_to_if post.is_approvable?, "Approve", moderator_post_approval_path(post_id: post.id), method: :post, remote: true, class: "approve-link btn" %> |
|
||||||
<%= link_to "Breaks Rules", moderator_post_disapproval_path(post_disapproval: { post_id: post.id, reason: "breaks_rules" }), method: :post, remote: true, class: "disapprove-link btn" %> |
|
<%= link_to "Breaks Rules", moderator_post_disapprovals_path(post_disapproval: { post_id: post.id, reason: "breaks_rules" }), method: :post, remote: true, class: "disapprove-link btn" %> |
|
||||||
<%= link_to "Poor Quality", moderator_post_disapproval_path(post_disapproval: { post_id: post.id, reason: "poor_quality" }), method: :post, remote: true, class: "disapprove-link btn" %> |
|
<%= link_to "Poor Quality", moderator_post_disapprovals_path(post_disapproval: { post_id: post.id, reason: "poor_quality" }), method: :post, remote: true, class: "disapprove-link btn" %> |
|
||||||
<%= link_to "No Interest", moderator_post_disapproval_path(post_disapproval: { post_id: post.id, reason: "disinterest" }), method: :post, remote: true, class: "disapprove-link btn" %> |
|
<%= link_to "No Interest", moderator_post_disapprovals_path(post_disapproval: { post_id: post.id, reason: "disinterest" }), method: :post, remote: true, class: "disapprove-link btn" %> |
|
||||||
<%= link_to "Detailed Rejection", "#", "data-post-id" => post.id, class: "detailed-rejection-link btn" %>
|
<%= link_to "Detailed Rejection", "#", "data-post-id" => post.id, class: "detailed-rejection-link btn" %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<div id="detailed-rejection-dialog" title="Detailed Rejection" style="display: none;">
|
<div id="detailed-rejection-dialog" title="Detailed Rejection" style="display: none;">
|
||||||
<p>You can supply a short message to the uploader explaining why you rejected this upload.</p>
|
<p>You can supply a short message to the uploader explaining why you rejected this upload.</p>
|
||||||
|
|
||||||
<%= simple_form_for(PostDisapproval.new, url: moderator_post_disapproval_path, remote: true, id: "detailed-rejection-form") do |f| %>
|
<%= simple_form_for(PostDisapproval.new, url: moderator_post_disapprovals_path, remote: true, id: "detailed-rejection-form") do |f| %>
|
||||||
<%= f.hidden_field :post_id, value: "x" %>
|
<%= f.hidden_field :post_id, value: "x" %>
|
||||||
<%= f.input :reason, collection: [["Breaks Rules", "breaks_rules"], ["Poor Quality", "poor_quality"], ["No interest", "disinterest"]] %>
|
<%= f.input :reason, collection: [["Breaks Rules", "breaks_rules"], ["Poor Quality", "poor_quality"], ["No interest", "disinterest"]] %>
|
||||||
<%= f.input :message, as: :string %>
|
<%= f.input :message, as: :string %>
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
<% if post.is_approvable? && !post.is_deleted? %>
|
<% if post.is_approvable? && !post.is_deleted? %>
|
||||||
<li><%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :remote => true, :method => :post, :id => "approve", :"data-shortcut" => "shift+o", :"data-confirm" => "Are you sure you want to approve this post?" %></li>
|
<li><%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :remote => true, :method => :post, :id => "approve", :"data-shortcut" => "shift+o", :"data-confirm" => "Are you sure you want to approve this post?" %></li>
|
||||||
<li><%= link_to "Hide from queue", moderator_post_disapproval_path(post_disapproval: { post_id: post.id, reason: "disinterest" }), remote: true, method: :post, id: "disapprove" %></li>
|
<li><%= link_to "Hide from queue", moderator_post_disapprovals_path(post_disapproval: { post_id: post.id, reason: "disinterest" }), remote: true, method: :post, id: "disapprove" %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if post.is_banned? %>
|
<% if post.is_banned? %>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<li><%= link_to("Mass Edit", edit_moderator_tag_path) %></li>
|
<li><%= link_to("Mass Edit", edit_moderator_tag_path) %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li><%= link_to("Similar Images Search", iqdb_queries_path) %></li>
|
<li><%= link_to("Similar Images Search", iqdb_queries_path) %></li>
|
||||||
|
<li><%= link_to("Disapprovals", moderator_post_disapprovals_path) %></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
<li><h1>Post Events</h1></li>
|
<li><h1>Post Events</h1></li>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Rails.application.routes.draw do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
resource :approval, :only => [:create]
|
resource :approval, :only => [:create]
|
||||||
resource :disapproval, :only => [:create]
|
resources :disapprovals, :only => [:create, :index]
|
||||||
resources :posts, :only => [:delete, :undelete, :expunge, :confirm_delete] do
|
resources :posts, :only => [:delete, :undelete, :expunge, :confirm_delete] do
|
||||||
member do
|
member do
|
||||||
get :confirm_delete
|
get :confirm_delete
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ module Moderator
|
|||||||
context "create action" do
|
context "create action" do
|
||||||
should "render" do
|
should "render" do
|
||||||
assert_difference("PostDisapproval.count", 1) do
|
assert_difference("PostDisapproval.count", 1) do
|
||||||
post_auth moderator_post_disapproval_path, @admin, params: { post_disapproval: { post_id: @post.id, reason: "breaks_rules" }, format: "js" }
|
post_auth moderator_post_disapprovals_path, @admin, params: { post_disapproval: { post_id: @post.id, reason: "breaks_rules" }, format: "js" }
|
||||||
end
|
end
|
||||||
assert_response :success
|
assert_response :success
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user