]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/redactions/show.html.erb
Fix new rubocop warnings
[rails.git] / app / views / redactions / show.html.erb
index 99f7cd1f1a42d834434f3ab37cfa72b8607d65ed..5b9749a5113b7f2c3caa686b98c84b7b3103c75a 100644 (file)
@@ -1,20 +1,24 @@
-<% @title = t('redaction.show.title') %>
+<% @title = t(".title") %>
 <% content_for :heading do %>
-  <h1><%= t('redaction.show.heading', :title => @redaction.title) %></h1>
+  <h1><%= t(".heading", :title => @redaction.title) %></h1>
 <% end %>
 
 <p>
-  <b><%= t 'redaction.show.user' %></b>
-  <%= link_to(@redaction.user.display_name, user_path(@redaction.user)) %>
+  <b><%= t ".user" %></b>
+  <%= link_to @redaction.user.display_name, @redaction.user %>
 </p>
-<p class="richtext">
-  <b><%= t 'redaction.show.description' %></b>
+<div class="richtext text-break">
+  <b><%= t ".description" %></b>
   <%= @redaction.description.to_html %>
-</p>
+</div>
 
-<% if current_user and current_user.moderator? %>
-<div class="buttons">
-  <%= button_to t('redaction.show.edit'), edit_redaction_path(@redaction), :method => :get %></td>
-  <%= button_to t('redaction.show.destroy'), @redaction, :method => "delete", :remote => true, :data => { :confirm => t('redaction.show.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 %>