added popular exploration, added order:rank

This commit is contained in:
albert
2011-08-11 15:39:51 -04:00
parent bd51079fc1
commit e42ea9c608
25 changed files with 296 additions and 61 deletions

View File

@@ -1,6 +1,7 @@
module PostSetPresenters
class Post
class Post < Base
attr_accessor :post_set, :tag_set_presenter
delegate :posts, :to => :post_set
def initialize(post_set)
@post_set = post_set
@@ -18,26 +19,8 @@ module PostSetPresenters
RelatedTagCalculator.calculate_from_sample_to_array(post_set.tag_string).map(&:first)
end
def posts
post_set.posts
end
def tag_list_html(template)
tag_set_presenter.tag_list_html(template)
end
def post_previews_html(template)
html = ""
if posts.empty?
return template.render(:partial => "post_sets/blank")
end
posts.each do |post|
html << PostPresenter.preview(post)
end
html.html_safe
end
end
end