Remove posts not shown for blank message check
This commit is contained in:
@@ -6,8 +6,7 @@ module PostSetPresenters
|
||||
|
||||
def post_previews_html(template, options = {})
|
||||
html = ""
|
||||
|
||||
if posts.empty?
|
||||
if none_shown(options)
|
||||
return template.render("post_sets/blank")
|
||||
end
|
||||
|
||||
@@ -18,5 +17,13 @@ module PostSetPresenters
|
||||
|
||||
html.html_safe
|
||||
end
|
||||
|
||||
def not_shown(post, options)
|
||||
!options[:show_deleted] && post.is_deleted? && @post_set.tag_string !~ /status:(?:all|any|deleted|banned)/ && !@post_set.raw
|
||||
end
|
||||
|
||||
def none_shown(options)
|
||||
posts.reject {|post| not_shown(post, options) }.empty?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user