diff --git a/app/controllers/moderator/post/queues_controller.rb b/app/controllers/moderator/post/queues_controller.rb index 205677d10..6b3f9364a 100644 --- a/app/controllers/moderator/post/queues_controller.rb +++ b/app/controllers/moderator/post/queues_controller.rb @@ -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 diff --git a/app/controllers/post_approvals_controller.rb b/app/controllers/post_approvals_controller.rb index 4377f80e3..79fbce004 100644 --- a/app/controllers/post_approvals_controller.rb +++ b/app/controllers/post_approvals_controller.rb @@ -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) diff --git a/app/controllers/post_disapprovals_controller.rb b/app/controllers/post_disapprovals_controller.rb index 7a9195608..c7c5dc072 100644 --- a/app/controllers/post_disapprovals_controller.rb +++ b/app/controllers/post_disapprovals_controller.rb @@ -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 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3a18abad1..3de619905 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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) diff --git a/app/javascript/src/javascripts/mod_queue.js b/app/javascript/src/javascripts/mod_queue.js index 588c4634a..b97c2fab2 100644 --- a/app/javascript/src/javascripts/mod_queue.js +++ b/app/javascript/src/javascripts/mod_queue.js @@ -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); }); diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb index f0abf5cee..44a06d7d0 100644 --- a/app/views/layouts/default.html.erb +++ b/app/views/layouts/default.html.erb @@ -122,10 +122,6 @@ <%= render "users/dmail_notice" %> <% end %> - <% if CurrentUser.user.can_approve_posts? %> - <%= render "moderator/post/queues/notice" %> - <% end %> -
"> <%= format_text(flash[:notice], inline: true) %>. close diff --git a/app/views/moderator/post/queues/_notice.html.erb b/app/views/moderator/post/queues/_notice.html.erb deleted file mode 100644 index c2264c2d9..000000000 --- a/app/views/moderator/post/queues/_notice.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<% if show_moderation_notice? %> -
- 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) %>. -
-<% end %> diff --git a/app/views/moderator/post/queues/random.html.erb b/app/views/moderator/post/queues/random.html.erb deleted file mode 100644 index 02ba4a85c..000000000 --- a/app/views/moderator/post/queues/random.html.erb +++ /dev/null @@ -1,32 +0,0 @@ -<% page_title "Mod Queue" %> - -
-
-
-

Moderation Queue

- -
-

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] %>).

- -

Deletion Guidelines

- - <%= render "desc" %> - -
- - <%= render "posts/partials/common/inline_blacklist" %> - - <% @posts.each do |post| %> - <%= render "post", post: post %> - <% end %> -
-
-
- -<%= render "post_disapprovals/detailed_rejection_dialog" %> -<%= render "posts/partials/common/secondary_links" %> - -<% content_for(:html_header) do %> - - -<% end %> diff --git a/app/views/post_approvals/create.js.erb b/app/views/post_approvals/create.js.erb index 163e7c8b3..8b2fa143b 100644 --- a/app/views/post_approvals/create.js.erb +++ b/app/views/post_approvals/create.js.erb @@ -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 %> diff --git a/app/views/post_disapprovals/create.js.erb b/app/views/post_disapprovals/create.js.erb index 4cdb1bb88..ff2540413 100644 --- a/app/views/post_disapprovals/create.js.erb +++ b/app/views/post_disapprovals/create.js.erb @@ -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 %> diff --git a/config/routes.rb b/config/routes.rb index 74e947e12..261cee601 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,11 +11,7 @@ Rails.application.routes.draw do end end namespace :post do - resource :queue, :only => [:show] do - member do - get :random - end - end + resource :queue, only: [:show] resources :posts, :only => [:delete, :expunge, :confirm_delete] do member do get :confirm_delete diff --git a/test/functional/moderator/post/queues_controller_test.rb b/test/functional/moderator/post/queues_controller_test.rb index 52b194bf5..672d61e36 100644 --- a/test/functional/moderator/post/queues_controller_test.rb +++ b/test/functional/moderator/post/queues_controller_test.rb @@ -18,13 +18,6 @@ module Moderator assert_response :success end end - - context "random action" do - should "render" do - get_auth moderator_post_queue_path, @admin - assert_response :success - end - end end end end