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 = {})
|
def post_previews_html(template, options = {})
|
||||||
html = ""
|
html = ""
|
||||||
|
if none_shown(options)
|
||||||
if posts.empty?
|
|
||||||
return template.render("post_sets/blank")
|
return template.render("post_sets/blank")
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -18,5 +17,13 @@ module PostSetPresenters
|
|||||||
|
|
||||||
html.html_safe
|
html.html_safe
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user