X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/e731dd71a77ad4ad1e9db22535e89444bb98e5d9..17bea98e199f204b22847356fc64beaa81a9373a:/app/views/redactions/show.html.erb

diff --git a/app/views/redactions/show.html.erb b/app/views/redactions/show.html.erb
index a87cca604..fe073d123 100644
--- a/app/views/redactions/show.html.erb
+++ b/app/views/redactions/show.html.erb
@@ -5,16 +5,20 @@
 
 <p>
   <b><%= t ".user" %></b>
-  <%= link_to(@redaction.user.display_name, user_path(@redaction.user)) %>
+  <%= link_to @redaction.user.display_name, @redaction.user %>
 </p>
-<div class="richtext">
+<div class="richtext text-break">
   <b><%= t ".description" %></b>
   <%= @redaction.description.to_html %>
 </div>
 
-<% if current_user and current_user.moderator? %>
-<div class="buttons">
-  <%= button_to t(".edit"), edit_redaction_path(@redaction), :method => :get %></td>
-  <%= button_to t(".destroy"), @redaction, :method => "delete", :remote => true, :data => { :confirm => t(".confirm") } %>
+<% if can?(:edit, Redaction) || can?(:destroy, Redaction) %>
+<div>
+  <% 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, :class => "btn btn-outline-danger", :data => { :turbo => true, :turbo_method => "DELETE", :turbo_confirm => t(".confirm") } %>
+  <% end %>
 </div>
 <% end %>