Show edit buttons on active blocks to all moderators

This commit is contained in:
Anton Khorev 2024-08-22 12:56:15 +03:00
parent ae3e804ee6
commit 67a5809c8a
3 changed files with 3 additions and 5 deletions

View file

@ -15,8 +15,7 @@
<% end %>
</td>
<td><%= link_to t(".show"), block %></td>
<td><% if current_user && (current_user.id == block.creator_id ||
current_user.id == block.revoker_id) %><%= link_to t(".edit"), edit_user_block_path(block) %><% end %></td>
<td><% if can?(:edit, block) %><%= link_to t(".edit"), edit_user_block_path(block) %><% end %></td>
<% if can?(:revoke, UserBlock) %>
<td><% if block.active? %><%= link_to t(".revoke"), revoke_user_block_path(block) %><% end %></td>
<% end %>

View file

@ -30,8 +30,7 @@
current_user.id == @user_block.revoker_id) ||
can?(:revoke, UserBlock) && @user_block.active? %>
<div>
<% if current_user && (current_user.id == @user_block.creator_id ||
current_user.id == @user_block.revoker_id) %>
<% if can?(:edit, @user_block) %>
<%= link_to t(".edit"), edit_user_block_path(@user_block), :class => "btn btn-outline-primary" %>
<% end %>
<% if can?(:revoke, UserBlock) && @user_block.active? %>