Add revoke all actions to received blocks resource

This commit is contained in:
Anton Khorev 2024-12-24 07:50:29 +03:00
parent 2df389c97e
commit df1c59280f
10 changed files with 120 additions and 115 deletions

View file

@ -6,7 +6,7 @@
<% unless @user.blocks.active.empty? %>
<%= bootstrap_form_for :revoke_all, :url => { :action => "revoke_all" } do |f| %>
<%= bootstrap_form_for :revoke_all, :url => { :action => :destroy }, :method => :delete do |f| %>
<div class="mb-3">
<div class="form-check">
<%= check_box_tag "confirm", "yes", false, { :class => "form-check-input" } %>

View file

@ -105,9 +105,9 @@
</li>
<% end %>
<% if can?(:revoke_all, UserBlock) and @user.blocks.active.exists? %>
<% if can?(:destroy, UserBlock) and @user.blocks.active.exists? %>
<li>
<%= link_to t(".revoke_all_blocks"), revoke_all_user_blocks_path(@user) %>
<%= link_to t(".revoke_all_blocks"), edit_user_received_blocks_path(@user) %>
</li>
<% end %>