]> git.openstreetmap.org Git - rails.git/commitdiff
Add "Blocks on user" nav tab to block list/show pages
authorAnton Khorev <tony29@yandex.ru>
Wed, 3 Apr 2024 09:17:01 +0000 (12:17 +0300)
committerAnton Khorev <tony29@yandex.ru>
Wed, 3 Apr 2024 09:17:01 +0000 (12:17 +0300)
app/views/user_blocks/_navigation.html.erb
config/locales/en.yml

index b7cc19ecfeaee5ae5c6bb9416c408c73c98d1b2a..bd389edbf3bf88cebf5e0b41f071907dc88be905 100644 (file)
                   :class => ["nav-link", { :active => action_name == "blocks_on" && current_user == @user }] %>
     </li>
   <% end %>
+  <% on_user = @user || @user_block&.user %>
+  <% if on_user != current_user && on_user&.blocks&.exists? %>
+    <li class="nav-item">
+      <%= link_to t(".blocks_on_user", :user => on_user.display_name),
+                  user_blocks_on_path(on_user),
+                  :class => ["nav-link", { :active => action_name == "blocks_on" }] %>
+    </li>
+  <% end %>
   <% if current_user&.blocks_created&.exists? %>
     <li class="nav-item">
       <%= link_to t(".blocks_by_me"),
index de2a4f89cd6a4c0e7a2e71009bf102cee2fc149a..96dd679564b54087ab171286320d168f2b6552d1 100644 (file)
@@ -2988,6 +2988,7 @@ en:
     navigation:
       all_blocks: "All Blocks"
       blocks_on_me: "Blocks on Me"
+      blocks_on_user: "Blocks on %{user}"
       blocks_by_me: "Blocks by Me"
   user_mutes:
     index: