X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/851de28303fc9c24d095b9452b862bea618ec0da..d404bc04d542d381a3233e8cf461f5c9fb981af2:/app/views/redactions/show.html.erb?ds=sidebyside
diff --git a/app/views/redactions/show.html.erb b/app/views/redactions/show.html.erb
index 04df9ade9..22d17cd5d 100644
--- a/app/views/redactions/show.html.erb
+++ b/app/views/redactions/show.html.erb
@@ -1,16 +1,24 @@
-<% @title = t('redaction.show.title') %>
-
<%= t('redaction.show.heading', :title => @redaction.title) %>
+<% @title = t(".title") %>
+<% content_for :heading do %>
+ <%= t(".heading", :title => @redaction.title) %>
+<% end %>
- <%= t 'redaction.show.user' %>
- <%= link_to(h(@redaction.user.display_name), {:controller => 'user', :action => 'view', :display_name => @redaction.user.display_name}) %>
+ <%= t ".user" %>
+ <%= link_to(@redaction.user.display_name, user_path(@redaction.user)) %>
-
- <%= t 'redaction.show.description' %>
+
+ <%= t ".description" %>
<%= @redaction.description.to_html %>
-
+
-<% if @user and @user.moderator? %>
-<%= link_to t('redaction.show.edit'), edit_redaction_path(@redaction) %>
-<%= button_to(t('redaction.show.destroy'), @redaction, :confirm => t('redaction.show.confirm'), :method => "delete", :remote => true) %>
+<% if can?(:edit, Redaction) || can?(:destroy, Redaction) %>
+
+ <% if can?(:edit, Redaction) %>
+ <%= link_to t(".edit"), edit_redaction_path(@redaction), :class => "btn btn-outline-primary" %>
+ <% end %>
+ <% if can?(:destroy, Redaction) %>
+ <%= link_to t(".destroy"), @redaction, :method => "delete", :class => "btn btn-outline-danger", :remote => true, :data => { :confirm => t(".confirm") } %>
+ <% end %>
+
<% end %>