post previews: fix thumbnail width/height outside post index.
Normally thumbnails have a fixed size of 154x154, but that's not always desirable outside of the posts index because it creates empty gaps around thumbnails.
This commit is contained in:
@@ -89,7 +89,7 @@ class PostPresenter < Presenter
|
||||
ApplicationController.render(partial: "posts/partials/index/preview", locals: locals)
|
||||
end
|
||||
|
||||
def self.preview_class(post, highlight_score: nil, pool: nil, size: nil, similarity: nil, **options)
|
||||
def self.preview_class(post, highlight_score: nil, pool: nil, size: nil, similarity: nil, compact: nil, **options)
|
||||
klass = ["post-preview"]
|
||||
# klass << " large-cropped" if post.has_cropped? && options[:show_cropped]
|
||||
klass << "captioned" if pool || size || similarity
|
||||
@@ -100,6 +100,7 @@ class PostPresenter < Presenter
|
||||
klass << "post-status-has-children" if post.has_visible_children?
|
||||
klass << "post-pos-score" if highlight_score && post.score >= 3
|
||||
klass << "post-neg-score" if highlight_score && post.score <= -3
|
||||
klass << "post-preview-compact" if compact
|
||||
klass
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user