refactor inactive janitor notice

This commit is contained in:
r888888888
2016-09-09 14:16:02 -07:00
parent 20cd6076a1
commit 3542ffe1f7

View File

@@ -27,11 +27,7 @@ class PostsController < ApplicationController
end
def show
if CurrentUser.can_approve_posts? && (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
notify_inactive_janitors
@post = Post.find(params[:id])
@post_flag = PostFlag.new(:post_id => @post.id)
@@ -118,6 +114,14 @@ 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])
end