posts/index: fix cropped thumbnails not being shown.
`show_cropped: true` wasn't being passed down to PostPresenter.preview.
This commit is contained in:
@@ -131,26 +131,26 @@ module PostSets
|
|||||||
@pending_bulk_update_requests ||= BulkUpdateRequest.pending.where_array_includes_any(:tags, tag.name)
|
@pending_bulk_update_requests ||= BulkUpdateRequest.pending.where_array_includes_any(:tags, tag.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def post_previews_html(template, show_cropped: true, **options)
|
def post_previews_html(template)
|
||||||
html = ""
|
html = ""
|
||||||
if none_shown(options)
|
if none_shown
|
||||||
return template.render("post_sets/blank")
|
return template.render("post_sets/blank")
|
||||||
end
|
end
|
||||||
|
|
||||||
posts.each do |post|
|
posts.each do |post|
|
||||||
html << PostPresenter.preview(post, options.merge(:tags => tag_string))
|
html << PostPresenter.preview(post, show_cropped: true, tags: tag_string)
|
||||||
html << "\n"
|
html << "\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
html.html_safe
|
html.html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
def not_shown(post, options)
|
def not_shown(post)
|
||||||
!options[:show_deleted] && post.is_deleted? && tag_string !~ /status:(?:all|any|deleted|banned)/
|
post.is_deleted? && tag_string !~ /status:(?:all|any|deleted|banned)/
|
||||||
end
|
end
|
||||||
|
|
||||||
def none_shown(options)
|
def none_shown
|
||||||
posts.reject {|post| not_shown(post, options) }.empty?
|
posts.reject {|post| not_shown(post) }.empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
concerning :TagListMethods do
|
concerning :TagListMethods do
|
||||||
|
|||||||
Reference in New Issue
Block a user