more intelligent notice for mod queue

This commit is contained in:
r888888888
2016-09-09 15:08:23 -07:00
parent 3542ffe1f7
commit 2c80d7b82e
6 changed files with 19 additions and 10 deletions

View File

@@ -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