fixes #675
This commit is contained in:
@@ -18,6 +18,8 @@ class PostPresenter < Presenter
|
|||||||
html = %{<article class="post-preview" id="post_#{post.id}" data-id="#{post.id}" data-tags="#{h(post.tag_string)}" data-uploader="#{h(post.uploader_name)}" data-rating="#{post.rating}" data-width="#{post.image_width}" data-height="#{post.image_height}" data-flags="#{flags.join(' ')}" data-parent-id="#{post.parent_id}" data-has-children="#{post.has_children?}" data-score="#{post.score}">}
|
html = %{<article class="post-preview" id="post_#{post.id}" data-id="#{post.id}" data-tags="#{h(post.tag_string)}" data-uploader="#{h(post.uploader_name)}" data-rating="#{post.rating}" data-width="#{post.image_width}" data-height="#{post.image_height}" data-flags="#{flags.join(' ')}" data-parent-id="#{post.parent_id}" data-has-children="#{post.has_children?}" data-score="#{post.score}">}
|
||||||
if options[:tags]
|
if options[:tags]
|
||||||
tag_param = "?tags=#{CGI::escape(options[:tags])}"
|
tag_param = "?tags=#{CGI::escape(options[:tags])}"
|
||||||
|
elsif options[:pool_id]
|
||||||
|
tag_param = "?pool_id=#{options[:pool_id]}"
|
||||||
else
|
else
|
||||||
tag_param = nil
|
tag_param = nil
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,5 +15,19 @@ module PostSetPresenters
|
|||||||
def tag_list_html(template)
|
def tag_list_html(template)
|
||||||
tag_set_presenter.tag_list_html(template)
|
tag_set_presenter.tag_list_html(template)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def post_previews_html(template)
|
||||||
|
html = ""
|
||||||
|
|
||||||
|
if posts.empty?
|
||||||
|
return template.render("post_sets/blank")
|
||||||
|
end
|
||||||
|
|
||||||
|
posts.each do |post|
|
||||||
|
html << PostPresenter.preview(post, :pool_id => post_set.pool.id)
|
||||||
|
end
|
||||||
|
|
||||||
|
html.html_safe
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user