X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/3d7eb387a7c3573f1a1d17df00adcaa1fb9b9fa5..17bea98e199f204b22847356fc64beaa81a9373a:/app/views/redactions/show.html.erb diff --git a/app/views/redactions/show.html.erb b/app/views/redactions/show.html.erb index 798ed962a..fe073d123 100644 --- a/app/views/redactions/show.html.erb +++ b/app/views/redactions/show.html.erb @@ -1,22 +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, {:controller => 'user', :action => 'view', :display_name => @redaction.user.display_name}) %> + <b><%= t ".user" %></b> + <%= link_to @redaction.user.display_name, @redaction.user %> </p> -<p> - <b><%= t 'redaction.show.description' %></b> +<div class="richtext text-break"> + <b><%= t ".description" %></b> <%= @redaction.description.to_html %> -</p> +</div> -<% if @user and @user.moderator? %> -<table> -<tr> -<td><%= button_to t('redaction.show.edit'), edit_redaction_path(@redaction), :method => :get %></td> -<td><%= button_to t('redaction.show.destroy'), @redaction, :method => "delete", :remote => true, :data => { :confirm => t('redaction.show.confirm') } %></td> -</tr> -</table> +<% 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 %>