This commit is contained in:
albert
2011-06-29 12:47:40 -04:00
parent 4e19d98047
commit 5cf122c2e0
14 changed files with 96 additions and 76 deletions

View File

@@ -0,0 +1,32 @@
module PostSetPresenters
class Pool
attr_accessor :tag_set_presenter
def initialize(pool_set)
@pool_set = pool_set
@tag_set_presenter = TagSetPresenter.new(
RelatedTagCalculator.calculate_from_sample_to_array(
pool_set.tag_string
).map {|x| x[0]}
)
end
def tag_list_html(template)
tag_set_presenter.tag_list_html(template)
end
def post_previews_html(template)
html = ""
if pool_set.posts.empty?
return template.render(:partial => "post_sets/blank")
end
pool_set.posts.each do |post|
html << PostPresenter.preview(post)
end
html.html_safe
end
end
end