From: Anton Khorev Date: Tue, 2 Apr 2024 15:17:14 +0000 (+0300) Subject: Move edit/revoke block buttons to the bottom X-Git-Tag: live~216^2~1 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/47b4b51e0805f6379d68bab23450c2a5c98a0e74 Move edit/revoke block buttons to the bottom --- diff --git a/app/views/user_blocks/show.html.erb b/app/views/user_blocks/show.html.erb index 94ea53b64..7e6566365 100644 --- a/app/views/user_blocks/show.html.erb +++ b/app/views/user_blocks/show.html.erb @@ -8,14 +8,6 @@ :block_by => link_to(@user_block.creator.display_name, @user_block.creator)) %> @@ -36,3 +28,15 @@
<%= t ".reason" %>
<%= @user_block.reason.to_html %>
+ +<% if @user_block.ends_at > Time.now.getutc && (current_user&.id == @user_block.creator_id || + can?(:revoke, UserBlock)) %> +
+ <% if current_user&.id == @user_block.creator_id %> + <%= link_to t(".edit"), edit_user_block_path(@user_block), :class => "btn btn-outline-primary" %> + <% end %> + <% if can?(:revoke, UserBlock) %> + <%= link_to t(".revoke"), revoke_user_block_path(@user_block), :class => "btn btn-outline-danger" %> + <% end %> +
+<% end %>