]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/redactions/show.html.erb
Converge redaction forms to use bootstrap
[rails.git] / app / views / redactions / show.html.erb
index a87cca604fd9c220a66fb07d22d24786e3c0fb99..22d17cd5d5c3ad503e17be5cc3724456f2e834e5 100644 (file)
@@ -7,14 +7,18 @@
   <b><%= t ".user" %></b>
   <%= link_to(@redaction.user.display_name, user_path(@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, :method => "delete", :class => "btn btn-outline-danger", :remote => true, :data => { :confirm => t(".confirm") } %>
+  <% end %>
 </div>
 <% end %>