Remove posts not shown for blank message check

This commit is contained in:
BrokenEagle
2020-01-17 06:08:13 +00:00
parent 34c3df78d9
commit b2d12e2e20

View File

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