refactor inactive janitor notice
This commit is contained in:
@@ -27,11 +27,7 @@ class PostsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
if CurrentUser.can_approve_posts? && (cookies[:moderated].blank? || Time.at(cookies[:moderated].to_i) < 1.day.ago)
|
notify_inactive_janitors
|
||||||
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
|
|
||||||
|
|
||||||
@post = Post.find(params[:id])
|
@post = Post.find(params[:id])
|
||||||
@post_flag = PostFlag.new(:post_id => @post.id)
|
@post_flag = PostFlag.new(:post_id => @post.id)
|
||||||
@@ -118,6 +114,14 @@ class PostsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
private
|
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
|
def tag_query
|
||||||
params[:tags] || (params[:post] && params[:post][:tags])
|
params[:tags] || (params[:post] && params[:post][:tags])
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user