more intelligent notice for mod queue
This commit is contained in:
@@ -9,7 +9,7 @@ div#page {
|
|||||||
margin: 0 20px;
|
margin: 0 20px;
|
||||||
padding: 0 10px;
|
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;
|
margin: 1em 0;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class ApplicationController < ActionController::Base
|
|||||||
# before_filter :secure_cookies_check
|
# before_filter :secure_cookies_check
|
||||||
layout "default"
|
layout "default"
|
||||||
force_ssl :if => :ssl_login?
|
force_ssl :if => :ssl_login?
|
||||||
|
helper_method :show_moderation_notice?
|
||||||
|
|
||||||
rescue_from Exception, :with => :rescue_exception
|
rescue_from Exception, :with => :rescue_exception
|
||||||
rescue_from User::PrivilegeError, :with => :access_denied
|
rescue_from User::PrivilegeError, :with => :access_denied
|
||||||
@@ -19,6 +20,10 @@ class ApplicationController < ActionController::Base
|
|||||||
rescue_from Danbooru::Paginator::PaginationError, :with => :render_pagination_limit
|
rescue_from Danbooru::Paginator::PaginationError, :with => :render_pagination_limit
|
||||||
|
|
||||||
protected
|
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?
|
def ssl_login?
|
||||||
cookies[:ssl_login].present?
|
cookies[:ssl_login].present?
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -31,6 +31,10 @@ module Moderator
|
|||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
|
def show_moderation_notice?
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
def per_page
|
def per_page
|
||||||
cookies["mq_per_page"] || params[:per_page] || 25
|
cookies["mq_per_page"] || params[:per_page] || 25
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ class PostsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
notify_inactive_janitors
|
|
||||||
|
|
||||||
@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)
|
||||||
@post_appeal = PostAppeal.new(:post_id => @post.id)
|
@post_appeal = PostAppeal.new(:post_id => @post.id)
|
||||||
@@ -114,13 +112,6 @@ 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])
|
||||||
|
|||||||
@@ -89,6 +89,10 @@
|
|||||||
<%= render "users/dmail_notice" %>
|
<%= render "users/dmail_notice" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<% if CurrentUser.user.can_approve_posts? %>
|
||||||
|
<%= render "moderator/post/queues/notice" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% if cookies["accepted_tos"].blank? && !CurrentUser.is_gold? %>
|
<% if cookies["accepted_tos"].blank? && !CurrentUser.is_gold? %>
|
||||||
<%= render "users/tos" %>
|
<%= render "users/tos" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
5
app/views/moderator/post/queues/_notice.html.erb
Normal file
5
app/views/moderator/post/queues/_notice.html.erb
Normal 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 %>
|
||||||
Reference in New Issue
Block a user