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

index 5ca67afe56b86481b6daa52ff72d8fa871675781..63f882f6c0dbb779c9ef137f3ed60a2a12766a43 100644 (file)
@@ -4,4 +4,11 @@
                 user_blocks_path,
                 :class => ["nav-link", { :active => action_name == "index" }] %>
   </li>
+  <% if current_user&.blocks&.exists? %>
+    <li class="nav-item">
+      <%= link_to t(".blocks_on_me"),
+                  user_blocks_on_path(current_user),
+                  :class => ["nav-link", { :active => action_name == "blocks_on" && current_user == @user }] %>
+    </li>
+  <% end %>
 </ul>
index d4fedb46ecd809a56198322ad384cf72d4db4f69..72e2ea05c80cbe321d983d958adf834056e5747f 100644 (file)
@@ -2987,6 +2987,7 @@ en:
       newer: "Newer Blocks"
     navigation:
       all_blocks: "All Blocks"
+      blocks_on_me: "Blocks on Me"
   user_mutes:
     index:
       title: "Muted Users"