From: mmd-osm Date: Wed, 31 Jul 2024 19:31:17 +0000 (+0200) Subject: Trace picture with fixed size X-Git-Tag: live~274^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/b4952ff7f20e296b00af8ec57382e5fd6d45ab09 Trace picture with fixed size --- diff --git a/app/helpers/trace_helper.rb b/app/helpers/trace_helper.rb index db1f8357e..fbbeb3dff 100644 --- a/app/helpers/trace_helper.rb +++ b/app/helpers/trace_helper.rb @@ -10,4 +10,12 @@ module TraceHelper image_tag trace_icon_path(trace.user, trace), options.merge(:size => 50) end + + def trace_picture(trace, options = {}) + options[:class] ||= "trace_image" + options[:alt] ||= "" + + image_tag trace_picture_path(trace.user, trace), + options.merge(:size => 250) + end end diff --git a/app/views/traces/edit.html.erb b/app/views/traces/edit.html.erb index 2059178cf..1c440adf2 100644 --- a/app/views/traces/edit.html.erb +++ b/app/views/traces/edit.html.erb @@ -2,7 +2,7 @@

<%= t ".heading", :name => @trace.name %>

<% end %> -<%= image_tag trace_picture_path(@trace.user, @trace), :class => "trace_image" %> +<%= trace_picture(@trace) %> <%= bootstrap_form_for @trace do |f| %> <%= f.text_field :name, :disabled => true %> diff --git a/app/views/traces/show.html.erb b/app/views/traces/show.html.erb index 51b21f982..63adf1572 100644 --- a/app/views/traces/show.html.erb +++ b/app/views/traces/show.html.erb @@ -4,7 +4,7 @@ <% if Settings.status != "gpx_offline" %> <% if @trace.inserted %> - <%= image_tag trace_picture_path(@trace.user, @trace), :class => "trace_image" %> + <%= trace_picture(@trace) %> <% else %> <%= t ".pending" %> <% end %>