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
|
||||
|
||||
Reference in New Issue
Block a user