add toggle for testing cropped thumbnails
This commit is contained in:
@@ -101,13 +101,13 @@
|
||||
margin: 0 auto;
|
||||
}
|
||||
img {
|
||||
object-fit: cover;
|
||||
object-fit: contain;
|
||||
width: 48.5vw;
|
||||
height: 48.5vw;
|
||||
margin: 0 auto;
|
||||
border: none;
|
||||
}
|
||||
img.cropped {
|
||||
img.cropped-true {
|
||||
object-fit: cover;
|
||||
}
|
||||
&[data-tags~=animated]:before, &[data-file-ext=swf]:before, &[data-file-ext=webm]:before, &[data-file-ext=mp4]:before, &[data-file-ext=zip]:before {
|
||||
|
||||
@@ -257,6 +257,10 @@ class AnonymousUser
|
||||
false
|
||||
end
|
||||
|
||||
def cropped_thumbnails?
|
||||
false
|
||||
end
|
||||
|
||||
User::Roles.reject {|r| r == :anonymous}.each do |name|
|
||||
define_method("is_#{name}?") do
|
||||
false
|
||||
|
||||
@@ -45,6 +45,7 @@ class User < ApplicationRecord
|
||||
is_super_voter
|
||||
disable_tagged_filenames
|
||||
enable_recent_searches
|
||||
cropped_thumbnails
|
||||
)
|
||||
|
||||
include Danbooru::HasBitFlags
|
||||
|
||||
@@ -32,7 +32,7 @@ class PostPresenter < Presenter
|
||||
tag_param = nil
|
||||
end
|
||||
html << %{<a href="#{path}/#{post.id}#{tag_param}">}
|
||||
html << %{<img itemprop="thumbnailUrl" src="#{post.preview_file_url}" alt="#{h(post.tag_string)}">}
|
||||
html << %{<img class="cropped-#{CurrentUser.cropped_thumbnails?}" itemprop="thumbnailUrl" src="#{post.preview_file_url}" alt="#{h(post.tag_string)}">}
|
||||
html << %{</a>}
|
||||
|
||||
if options[:pool]
|
||||
|
||||
Reference in New Issue
Block a user