]> git.openstreetmap.org Git - rails.git/commitdiff
Ask for confirmation before deleting a trace
authorTom Hughes <tom@compton.nu>
Thu, 5 Apr 2018 20:16:28 +0000 (21:16 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 5 Apr 2018 20:16:28 +0000 (21:16 +0100)
Fixes #1812

app/views/trace/view.html.erb
config/locales/en.yml

index df45f2f2d1102b3b82232f5d5e1a448971a5dba6..8fc17a1f2fd2079bfdea47c11d828f77cb28dc03 100644 (file)
@@ -59,6 +59,6 @@
     <%= if_user(@trace.user) do %>
       <%= button_to t('trace.view.edit_track'), trace_edit_path(@trace) %>
     <% end %>
-    <%= button_to t('trace.view.delete_track'), :controller => 'trace', :action => 'delete', :id => @trace.id %>
+    <%= button_to t('trace.view.delete_track'), { :controller => 'trace', :action => 'delete', :id => @trace.id }, :data => { :confirm => t('trace.view.confirm_delete') } %>
   </div>
 <% end %>
index af33f34f8b97f23c90d78ebaaebf4efacb11ebd7..7df06b2771e4ca351c3b880445a8909e452ac73d 100644 (file)
@@ -1636,6 +1636,7 @@ en:
       delete_track: "Delete this trace"
       trace_not_found: "Trace not found!"
       visibility: "Visibility:"
+      confirm_delete: "Delete this trace?"
     trace_paging_nav:
       showing_page: "Page %{page}"
       older: "Older Traces"