diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index e67a6e3b2..0081293b3 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1126,8 +1126,8 @@ div.attachments img { vertical-align: middle; } div.attachments span.author { font-size: 0.9em; color: #888; } div.thumbnails {margin:0.6em;} -div.thumbnails div {background:#fff;border:2px solid #ddd;display:inline-block;margin-right:2px;} -div.thumbnails img {margin: 3px; vertical-align: middle;} +div.thumbnail {background:#fff;border:2px solid #ddd;display:inline-block;margin-right:2px;} +div.thumbnail img {margin: 3px; vertical-align: middle;} #history div.thumbnails {margin-left: 2em;} p.other-formats { text-align: right; font-size:0.9em; color: #666; } diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3174261a9..50519c890 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -346,18 +346,18 @@ module ApplicationHelper def thumbnail_tag(attachment) thumbnail_size = Setting.thumbnails_size.to_i thumbnail_path = thumbnail_path(attachment, :size => thumbnail_size * 2) - link_to( - image_tag( - thumbnail_path, - :srcset => "#{thumbnail_path} 2x", - :style => "max-width: #{thumbnail_size}px; max-height: #{thumbnail_size}px;", - :title => attachment.filename, - :loading => "lazy" - ), - attachment_path( - attachment + tag.div class: 'thumbnail', title: attachment.filename do + link_to( + image_tag( + thumbnail_path, + :srcset => "#{thumbnail_path} 2x", + :style => "max-width: #{thumbnail_size}px; max-height: #{thumbnail_size}px;", + :alt => attachment.filename, + :loading => "lazy" + ), + attachment_path(attachment) ) - ) + end end def toggle_link(name, id, options={}) diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb index f098c1038..93cbddaea 100644 --- a/app/views/attachments/_links.html.erb +++ b/app/views/attachments/_links.html.erb @@ -42,7 +42,7 @@ <% if images.any? %>