This commit is contained in:
albert
2011-10-26 18:20:40 -04:00
parent 89636d9ba3
commit 5a52ccbbc9
2 changed files with 2 additions and 2 deletions

View File

@@ -41,7 +41,7 @@ class Post < ActiveRecord::Base
scope :commented_before, lambda {|date| where("last_commented_at < ?", date).order("last_commented_at DESC")}
scope :has_notes, where("last_noted_at is not null")
scope :for_user, lambda {|user_id| where(["uploader_id = ?", user_id])}
scope :available_for_moderation, lambda {|hidden| hidden.present? ? where(["id NOT IN (SELECT pd.post_id FROM post_disapprovals pd WHERE pd.user_id = ?)", CurrentUser.id]) : where(["id NOT IN (SELECT pd.post_id FROM post_disapprovals pd WHERE pd.user_id = ?)", CurrentUser.id])}
scope :available_for_moderation, lambda {|hidden| hidden.present? ? where(["id IN (SELECT pd.post_id FROM post_disapprovals pd WHERE pd.user_id = ?)", CurrentUser.id]) : where(["id NOT IN (SELECT pd.post_id FROM post_disapprovals pd WHERE pd.user_id = ?)", CurrentUser.id])}
scope :hidden_from_moderation, lambda {where(["id IN (SELECT pd.post_id FROM post_disapprovals pd WHERE pd.user_id = ?)", CurrentUser.id])}
scope :tag_match, lambda {|query| Post.tag_match_helper(query)}
scope :exact_tag_match, lambda {|query| Post.exact_tag_match_helper(query)}

View File

@@ -15,7 +15,7 @@
<p>
As a general rule, you should only approve of posts that you personally like. Posts that are not approved in three days will be automatically deleted. Posts with score -3 or lower are marked red. Posts with score 3 or higher are marked green.
<% if params[:hidden] %>
<%= link_to "View all posts", moderator_post_queue_path(:query => params[:query], :hidden => nil) %>.
<%= link_to "View pending posts", moderator_post_queue_path(:query => params[:query], :hidden => nil) %>.
<% else %>
<%= link_to "View hidden posts", moderator_post_queue_path(:query => params[:query], :hidden => true) %>.
<% end %>