]> git.openstreetmap.org Git - rails.git/commitdiff
Trace picture with fixed size
authormmd-osm <mmd.osm@gmail.com>
Wed, 31 Jul 2024 19:31:17 +0000 (21:31 +0200)
committermmd-osm <mmd.osm@gmail.com>
Wed, 31 Jul 2024 19:31:17 +0000 (21:31 +0200)
app/helpers/trace_helper.rb
app/views/traces/edit.html.erb
app/views/traces/show.html.erb

index db1f8357ea39c30339491c1ca1cb04ca7466fbf0..fbbeb3dffb48e376c1aeef5053ef39c166b2950b 100644 (file)
@@ -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
index 2059178cfa91303ca496f68839d590f6db097141..1c440adf25432440ac04b2f1dc330f137df66617 100644 (file)
@@ -2,7 +2,7 @@
   <h1><%= t ".heading", :name => @trace.name %></h1>
 <% 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 %>
index 51b21f9828e0f72cfdd56488f0e6657e9098a442..63adf15729c5aaa662d2f4f3d111b6d4d00de5c7 100644 (file)
@@ -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 %>
     <span class="text-danger"><%= t ".pending" %></span>
   <% end %>