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

@@ -9,7 +9,7 @@ div#page {
margin: 0 20px;
padding: 0 10px;
div#upgrade-account-notice, div#sign-up-notice, div#tos-notice, div#ban-notice, div#dmail-notice {
div#upgrade-account-notice, div#sign-up-notice, div#tos-notice, div#ban-notice, div#dmail-notice, div#mod-notice {
margin: 1em 0;
padding: 1em;
text-align: center;

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

View File

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

View File

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

View File

@@ -89,6 +89,10 @@
<%= render "users/dmail_notice" %>
<% end %>
<% if CurrentUser.user.can_approve_posts? %>
<%= render "moderator/post/queues/notice" %>
<% end %>
<% if cookies["accepted_tos"].blank? && !CurrentUser.is_gold? %>
<%= render "users/tos" %>
<% end %>

View File

@@ -0,0 +1,5 @@
<% if show_moderation_notice? %>
<div class="ui-corner-all ui-state-highlight" id="mod-notice">
<span>You haven't moderated any posts in awhile. Consider checking out the <%= link_to "queue", random_moderator_post_queue_path(:return_to => request.original_url) %>.</span>
</div>
<% end %>