pools/gallery: refactor post previews.

This commit is contained in:
evazion
2020-01-12 20:54:41 -06:00
parent 76c4ba6f18
commit 083ce75c10
6 changed files with 7 additions and 55 deletions

View File

@@ -1,28 +0,0 @@
module PostSetPresenters
class PoolGallery < Base
attr_accessor :post_set
delegate :pools, :to => :post_set
def initialize(post_set)
@post_set = post_set
end
def post_previews_html(template)
html = ""
if pools.empty?
return template.render("post_sets/blank")
end
pools.each do |pool|
if pool.cover_post_id
post = ::Post.find(pool.cover_post_id)
html << PostPresenter.preview(post, link_target: pool, pool: pool, show_deleted: true)
html << "\n"
end
end
html.html_safe
end
end
end