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 df45f2f..8fc17a1 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 af33f34..7df06b2 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"