Display past blocks button on accounts block page

This commit is contained in:
Anton Khorev 2025-01-20 07:34:44 +03:00
parent 1ae9289710
commit 119b7f4959
3 changed files with 11 additions and 0 deletions

View file

@ -3,3 +3,9 @@
<% end %>
<p><%= t ".no_active_blocks" %></p>
<% if current_user.blocks.exists? %>
<div class="mb-3">
<%= link_to t(".review_button"), user_received_blocks_path(current_user), :class => "btn btn-outline-primary" %>
</div>
<% end %>

View file

@ -283,6 +283,7 @@ en:
index:
title: Blocks on Me
no_active_blocks: There are no active blocks on your account.
review_button: Review past blocks
deletions:
show:
title: Delete My Account

View file

@ -24,6 +24,7 @@ module Accounts
assert_response :success
assert_dom "#content > .content-body" do
assert_dom "p", :text => /no active blocks/
assert_dom "a", :text => "Review past blocks", :count => 0
end
end
@ -36,6 +37,9 @@ module Accounts
assert_response :success
assert_dom "#content > .content-body" do
assert_dom "p", :text => /no active blocks/
assert_dom "a", :text => "Review past blocks" do
assert_dom "> @href", user_received_blocks_path(user)
end
end
end