more intelligent notice for mod queue
This commit is contained in:
@@ -12,6 +12,7 @@ class ApplicationController < ActionController::Base
|
||||
# before_filter :secure_cookies_check
|
||||
layout "default"
|
||||
force_ssl :if => :ssl_login?
|
||||
helper_method :show_moderation_notice?
|
||||
|
||||
rescue_from Exception, :with => :rescue_exception
|
||||
rescue_from User::PrivilegeError, :with => :access_denied
|
||||
@@ -19,6 +20,10 @@ class ApplicationController < ActionController::Base
|
||||
rescue_from Danbooru::Paginator::PaginationError, :with => :render_pagination_limit
|
||||
|
||||
protected
|
||||
def show_moderation_notice?
|
||||
CurrentUser.can_approve_posts? && (cookies[:moderated].blank? || Time.at(cookies[:moderated].to_i) < 1.day.ago)
|
||||
end
|
||||
|
||||
def ssl_login?
|
||||
cookies[:ssl_login].present?
|
||||
end
|
||||
|
||||
@@ -31,6 +31,10 @@ module Moderator
|
||||
|
||||
protected
|
||||
|
||||
def show_moderation_notice?
|
||||
false
|
||||
end
|
||||
|
||||
def per_page
|
||||
cookies["mq_per_page"] || params[:per_page] || 25
|
||||
end
|
||||
|
||||
@@ -27,8 +27,6 @@ class PostsController < ApplicationController
|
||||
end
|
||||
|
||||
def show
|
||||
notify_inactive_janitors
|
||||
|
||||
@post = Post.find(params[:id])
|
||||
@post_flag = PostFlag.new(:post_id => @post.id)
|
||||
@post_appeal = PostAppeal.new(:post_id => @post.id)
|
||||
@@ -114,13 +112,6 @@ class PostsController < ApplicationController
|
||||
end
|
||||
|
||||
private
|
||||
def notify_inactive_janitors
|
||||
if CurrentUser.can_approve_posts? && flash[:notice].blank? && (cookies[:moderated].blank? || Time.at(cookies[:moderated].to_i) < 1.day.ago)
|
||||
flash[:notice] = "You haven't moderated any posts recently. Consider checking the queue."
|
||||
#redirect_to(random_moderator_post_queue_path(:return_to => request.original_url))
|
||||
#return
|
||||
end
|
||||
end
|
||||
|
||||
def tag_query
|
||||
params[:tags] || (params[:post] && params[:post][:tags])
|
||||
|
||||
Reference in New Issue
Block a user