X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/673b58f96f3acfd0281c62a2a7f080825b6fb28b..fb16b5ed14fa9f7f043522674fb4f37628f07c8e:/app/views/trace/view.html.erb?ds=sidebyside diff --git a/app/views/trace/view.html.erb b/app/views/trace/view.html.erb index 57cc39a08..8fc17a1f2 100644 --- a/app/views/trace/view.html.erb +++ b/app/views/trace/view.html.erb @@ -13,7 +13,7 @@ - + @@ -30,7 +30,7 @@ <% end %> - + @@ -54,9 +54,11 @@

-<%= if_user(@trace.user) do %> +<% if current_user && (current_user==@trace.user || current_user.administrator? || current_user.moderator?)%>
- <%= button_to t('trace.view.edit_track'), :controller => 'trace', :action => 'edit', :id => @trace.id %> - <%= button_to t('trace.view.delete_track'), :controller => 'trace', :action => 'delete', :id => @trace.id %> + <%= 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 }, :data => { :confirm => t('trace.view.confirm_delete') } %>
<% end %>
<%= t'trace.view.filename' %><%= @trace.name %> (<%= link_to t('trace.view.download'), :controller => 'trace', :action => 'data', :id => @trace.id %>)<%= @trace.name %> (<%= link_to t('trace.view.download'), trace_data_path(@trace) %>)
<%= t'trace.view.uploaded' %>
<%= t'trace.view.owner' %><%= link_to h(@trace.user.display_name), {:controller => 'user', :action => 'view', :display_name => @trace.user.display_name} %><%= link_to h(@trace.user.display_name), user_path(@trace.user) %>
<%= t'trace.view.description' %>