add tag seq nav
This commit is contained in:
@@ -16,7 +16,12 @@ class PostPresenter < Presenter
|
||||
path = options[:path_prefix] || "/posts"
|
||||
|
||||
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 << %{<a href="#{path}/#{post.id}">}
|
||||
if options[:tags]
|
||||
tag_param = "?tags=#{CGI::escape(options[:tags])}"
|
||||
else
|
||||
tag_param = nil
|
||||
end
|
||||
html << %{<a href="#{path}/#{post.id}#{tag_param}">}
|
||||
html << %{<img src="#{post.preview_file_url}" alt="#{h(post.tag_string)}">}
|
||||
html << %{</a>}
|
||||
html << %{</article>}
|
||||
|
||||
@@ -12,7 +12,7 @@ module PostSetPresenters
|
||||
end
|
||||
|
||||
posts.each do |post|
|
||||
html << PostPresenter.preview(post)
|
||||
html << PostPresenter.preview(post, :tags => template.params[:tags])
|
||||
end
|
||||
|
||||
html.html_safe
|
||||
|
||||
Reference in New Issue
Block a user