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

index bd389edbf3bf88cebf5e0b41f071907dc88be905..a84ba133985c0b4331f339f669f1fc9296358547 100644 (file)
                   :class => ["nav-link", { :active => action_name == "blocks_by" && current_user == @user }] %>
     </li>
   <% end %>
+  <% by_user = @user || @user_block&.creator %>
+  <% if by_user != current_user && by_user&.blocks_created&.exists? %>
+    <li class="nav-item">
+      <%= link_to t(".blocks_by_user", :user => by_user.display_name),
+                  user_blocks_by_path(by_user),
+                  :class => ["nav-link", { :active => action_name == "blocks_by" }] %>
+    </li>
+  <% end %>
 </ul>
index 96dd679564b54087ab171286320d168f2b6552d1..0634fc2a0d1f52b1000462318c6bf42b0620d422 100644 (file)
@@ -2990,6 +2990,7 @@ en:
       blocks_on_me: "Blocks on Me"
       blocks_on_user: "Blocks on %{user}"
       blocks_by_me: "Blocks by Me"
+      blocks_by_user: "Blocks by %{user}"
   user_mutes:
     index:
       title: "Muted Users"