added popular exploration, added order:rank
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
module PostSetPresenters
|
||||
class Pool
|
||||
attr_reader :tag_set_presenter, :pool_set
|
||||
class Pool < Base
|
||||
attr_reader :tag_set_presenter, :post_set
|
||||
delegate :posts, :to => :post_set
|
||||
|
||||
def initialize(pool_set)
|
||||
@pool_set = pool_set
|
||||
def initialize(post_set)
|
||||
@post_set = post_set
|
||||
@tag_set_presenter = TagSetPresenter.new(
|
||||
RelatedTagCalculator.calculate_from_sample_to_array(
|
||||
pool_set.tag_string
|
||||
post_set.tag_string
|
||||
).map {|x| x[0]}
|
||||
)
|
||||
end
|
||||
@@ -14,19 +15,5 @@ module PostSetPresenters
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user