Add a menu in the top right of the post index page that lets you select the thumbnail size. This menu is currently hidden until the new thumbnails have been generated. On desktop, there are five thumbnail sizes: * Small: 150x150 (https://danbooru.donmai.us/posts?size=150) * Medium: 180x180 (https://danbooru.donmai.us/posts?size=180) * Large: 225x225 (https://danbooru.donmai.us/posts?size=225) * Huge: 270x270 (https://danbooru.donmai.us/posts?size=270) * Gigantic: 360x360 (https://danbooru.donmai.us/posts?size=360) On mobile, there are four sizes: * Small: 150x150 / 3 posts per row (https://danbooru.donmai.us/posts?size=150) * Medium: 180x180 / 2 posts per row (https://danbooru.donmai.us/posts?size=180) * Large: 225x225 / 2 posts per row (https://danbooru.donmai.us/posts?size=225) * Huge: 360x360 / 1 posts per row (https://danbooru.donmai.us/posts?size=360) There are two extra sizes that aren't listed in the menu: * 225x360 (https://danbooru.donmai.us/posts?size=225w) * 270x360 (https://danbooru.donmai.us/posts?size=270w) These sizes are good for tall thumbnails, but not so much for wide thumbnails. They aren't listed because in practice they're a bit too big. The 225x225 and 270x270 sizes are really just 360x360 thumbnails scaled down in HTML. This means 225x225 and 360x360 thumbnails both use the same amount of bandwidth. Thumbnail size is currently a per-search option, not a persistent account-level setting. This changes the HTML structure of thumbnails somewhat, so this may break userscripts and custom CSS.
59 lines
2.2 KiB
Plaintext
59 lines
2.2 KiB
Plaintext
<%= tag.article id: "post_#{post.id}", **article_attrs do -%>
|
|
<%= link_to polymorphic_path(link_target, q: tags), class: "post-preview-link" do -%>
|
|
<% if is_animated? || has_sound? %>
|
|
<div class="post-animation-icon absolute top-0.5 left-0.5 p-0.5 m-0.5 leading-none rounded text-xs font-arial font-bold">
|
|
<% if is_animated? %>
|
|
<span class="post-duration align-middle">
|
|
<%= duration_to_hhmmss(duration) %>
|
|
</span>
|
|
<% end %>
|
|
<% if has_sound? %>
|
|
<%= sound_icon(class: "h-3 mx-0.5") -%>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<%= tag.img srcset: preview_srcset, src: preview_url, width: variant.width, height: variant.height, class: "post-preview-image", title: tooltip, alt: "post ##{post.id}", crossorigin: "anonymous" -%>
|
|
<% end -%>
|
|
<% if pool -%>
|
|
<p class="desc">
|
|
<%= link_to pool.pretty_name.truncate(80), pool %>
|
|
</p>
|
|
<% elsif similarity -%>
|
|
<p class="desc">
|
|
<% if post.source =~ %r!\Ahttps?://!i %>
|
|
<%= external_link_to post.normalized_source, post.source_domain %>
|
|
(<%= time_ago_in_words_tagged(post.created_at, compact: true) %>)
|
|
<% else %>
|
|
<%= time_ago_in_words_tagged(post.created_at, compact: true) %>
|
|
<% end %>
|
|
</p>
|
|
<p class="desc">
|
|
<%= link_to number_to_human_size(size), post.file_url %>
|
|
(<%= post.image_width %>x<%= post.image_height %>)
|
|
</p>
|
|
<p class="desc">
|
|
<%= link_to "#{similarity}%", iqdb_queries_path(post_id: post.id) %> similarity
|
|
</p>
|
|
<% elsif show_size -%>
|
|
<p class="desc">
|
|
<%= link_to number_to_human_size(file_size), post.file_url %>
|
|
(<%= post.image_width %>x<%= post.image_height %>)
|
|
</p>
|
|
<% elsif recommended -%>
|
|
<p class="desc recommended">
|
|
<%= link_to recommended_posts_path(search: { post_id: post.id }), class: "more-recommended-posts", "data-post-id": post.id do %>
|
|
<%= post.fav_count %>
|
|
|
|
<%= empty_heart_icon(class: "fa-xs") %>
|
|
|
|
<br>more »
|
|
<% end %>
|
|
</p>
|
|
<% elsif show_votes -%>
|
|
<div class="post-preview-score text-sm text-center mt-1">
|
|
<%= render_post_votes post, current_user: current_user %>
|
|
</div>
|
|
<% end -%>
|
|
<% end -%>
|