make pool gallery the default view
This commit is contained in:
@@ -27,7 +27,7 @@ class PostPresenter < Presenter
|
||||
if options[:pool]
|
||||
html << %{<p class="desc">}
|
||||
html << %{<a href="/pools/#{options[:pool].id}">}
|
||||
html << options[:pool].pretty_name.truncate(40)
|
||||
html << options[:pool].pretty_name.truncate(80)
|
||||
html << %{</a>}
|
||||
html << %{</p>}
|
||||
end
|
||||
|
||||
@@ -14,9 +14,10 @@ module PostSetPresenters
|
||||
return template.render("post_sets/blank")
|
||||
end
|
||||
|
||||
posts = ::Post.where(id: pools.map(&:cover_post_id)).to_a.inject({}) {|h, x| h[x.id] = x; h}
|
||||
|
||||
pools.each do |pool|
|
||||
if pool.cover_post_id
|
||||
post = ::Post.find(pool.cover_post_id)
|
||||
if post = posts[pool.cover_post_id.to_i]
|
||||
html << PostPresenter.preview(post, options.merge(:tags => @post_set.tag_string, :raw => @post_set.raw, :pool => pool))
|
||||
html << "\n"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user