approvers: remove "you haven't moderated in awhile" notice.

Remove the nag message when an approver hasn't approved anything
recently. Also remove the modqueue random posts page. As of 3d410398a,
inactive approvers are now warned via dmails.
This commit is contained in:
evazion
2020-02-28 14:28:08 -06:00
parent 41103cb6b5
commit cded0f763b
12 changed files with 1 additions and 95 deletions
@@ -1,15 +1,11 @@
module Moderator
module Post
class QueuesController < ApplicationController
RANDOM_COUNT = 12
respond_to :html, :json
before_action :approver_only
skip_before_action :api_check
def show
cookies.permanent[:moderated] = Time.now.to_i
if search_params[:per_page]
cookies.permanent["mq_per_page"] = search_params[:per_page]
end
@@ -21,23 +17,6 @@ module Moderator
respond_with(@posts)
end
def random
cookies.permanent[:moderated] = Time.now.to_i
::Post.without_timeout do
@posts = ::Post.includes(:disapprovals, :uploader).order("posts.id asc").pending_or_flagged.available_for_moderation(false).reorder("random()").limit(RANDOM_COUNT)
@posts.each # hack to force rails to eager load
if @posts.empty?
flash[:notice] = "Nothing left to moderate!"
redirect_to(params[:return_to] || posts_path)
return
end
end
respond_with(@posts)
end
protected
def per_page
@@ -3,7 +3,6 @@ class PostApprovalsController < ApplicationController
respond_to :html, :xml, :json, :js
def create
cookies.permanent[:moderated] = Time.now.to_i
post = Post.find(params[:post_id])
@approval = post.approve!
respond_with(@approval)
@@ -4,7 +4,6 @@ class PostDisapprovalsController < ApplicationController
respond_to :js, :html, :json, :xml
def create
cookies.permanent[:moderated] = Time.now.to_i
@post_disapproval = PostDisapproval.create(user: CurrentUser.user, **post_disapproval_params)
respond_with(@post_disapproval)
end
-4
View File
@@ -333,10 +333,6 @@ module ApplicationHelper
content_for(:html_header, auto_discovery_link_tag(:atom, url, title: title))
end
def show_moderation_notice?
CurrentUser.can_approve_posts? && (cookies[:moderated].blank? || Time.at(cookies[:moderated].to_i) < 72.hours.ago)
end
protected
def nav_link_match(controller, url)
@@ -2,18 +2,6 @@ import Utility from './utility'
let ModQueue = {};
ModQueue.processed = 0;
ModQueue.increment_processed = function() {
if (Utility.meta("random-mode") === "1") {
ModQueue.processed += 1;
if (ModQueue.processed === 12) {
window.location = Utility.meta("return-to");
}
}
}
ModQueue.detailed_rejection_dialog = function() {
$("#post_disapproval_post_id").val($(this).data("post-id"));
$("#detailed-rejection-dialog").find("form")[0].reset();
@@ -23,7 +11,6 @@ ModQueue.detailed_rejection_dialog = function() {
}
$(function() {
$(window).on("danbooru:modqueue_increment_processed", ModQueue.increment_processed);
$(document).on("click.danbooru", ".quick-mod .detailed-rejection-link", ModQueue.detailed_rejection_dialog);
});
-4
View File
@@ -122,10 +122,6 @@
<%= render "users/dmail_notice" %>
<% end %>
<% if CurrentUser.user.can_approve_posts? %>
<%= render "moderator/post/queues/notice" %>
<% end %>
<div class="notice notice-info" id="notice" style="<%= "display: none;" unless flash[:notice] %>">
<span class="prose"><%= format_text(flash[:notice], inline: true) %>.</span>
<a href="#" id="close-notice-link">close</a>
@@ -1,5 +0,0 @@
<% if show_moderation_notice? %>
<div class="notice notice-info notice-large" id="mod-notice">
<span>You haven't moderated any posts in awhile. Consider checking out the <%= link_to "queue", random_moderator_post_queue_path(:return_to => request.original_url) %>.</span>
</div>
<% end %>
@@ -1,32 +0,0 @@
<% page_title "Mod Queue" %>
<div id="c-moderator-post-queues">
<div id="a-random">
<div>
<h1>Moderation Queue</h1>
<div id="moderation-guideline">
<p>Here are twelve random posts that are up for moderation. See if any of them are worth approving. Once you finish processing all of them you will be taken to the previous URL (<%= params[:return_to] %>).</p>
<h1>Deletion Guidelines</h1>
<%= render "desc" %>
</div>
<%= render "posts/partials/common/inline_blacklist" %>
<% @posts.each do |post| %>
<%= render "post", post: post %>
<% end %>
</div>
</div>
</div>
<%= render "post_disapprovals/detailed_rejection_dialog" %>
<%= render "posts/partials/common/secondary_links" %>
<% content_for(:html_header) do %>
<meta name="random-mode" content="1">
<meta name="return-to" content="<%= params[:return_to] %>">
<% end %>
-1
View File
@@ -5,7 +5,6 @@
location.reload();
} else if ($("#c-moderator-post-queues").length) {
$("#c-moderator-post-queues #post-<%= @approval.post.id %>").hide();
$(window).trigger("danbooru:modqueue_increment_processed");
Danbooru.notice("Post was approved");
}
<% end %>
@@ -5,7 +5,6 @@
location.reload();
} else if ($("#c-moderator-post-queues").length) {
$("#c-moderator-post-queues #post-<%= @post_disapproval.post.id %>").hide();
$(window).trigger("danbooru:modqueue_increment_processed");
Danbooru.notice("Post was hidden");
}
<% end %>