From: mmd-osm Date: Mon, 29 Jul 2024 18:39:00 +0000 (+0200) Subject: Trace image with fixed size X-Git-Tag: live~336^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/72177a3f20d31e081372f5174b72354192e40a3b Trace image with fixed size --- diff --git a/app/helpers/trace_helper.rb b/app/helpers/trace_helper.rb index aec1146cb..db1f8357e 100644 --- a/app/helpers/trace_helper.rb +++ b/app/helpers/trace_helper.rb @@ -2,4 +2,12 @@ module TraceHelper def link_to_tag(tag) link_to(tag, :tag => tag, :page => nil) end + + def trace_icon(trace, options = {}) + options[:class] ||= "trace_image" + options[:alt] ||= "" + + image_tag trace_icon_path(trace.user, trace), + options.merge(:size => 50) + end end diff --git a/app/views/traces/_trace.html.erb b/app/views/traces/_trace.html.erb index ba503f730..f60eea7f1 100644 --- a/app/views/traces/_trace.html.erb +++ b/app/views/traces/_trace.html.erb @@ -2,7 +2,7 @@ <% if Settings.status != "gpx_offline" %> <% if trace.inserted %> - <%= link_to image_tag(trace_icon_path(trace.user, trace), :alt => "", :class => "trace_image"), + <%= link_to trace_icon(trace), show_trace_path(trace.user, trace), :class => "d-inline-block" %> <% else %>