From 20ae1926a80d098da9370687445edb24d2a12538 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Mon, 2 Dec 2024 12:22:45 +0300 Subject: [PATCH] Truncate usernames in block navigation tabs --- app/assets/stylesheets/common.scss | 6 +++++- app/views/user_blocks/_navigation.html.erb | 4 ++-- config/locales/en.yml | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 4bedf42b6a..b179ec5ada 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -938,7 +938,11 @@ div.secondary-actions { max-width: 20em; } -/* Rules for tabs inside secondary background sections */ +/* Rules for navigation tabs */ + +.nav-tabs .username { + max-width: 20em; +} .bg-body-secondary .nav-tabs { --bs-border-color: var(--bs-secondary-border-subtle); diff --git a/app/views/user_blocks/_navigation.html.erb b/app/views/user_blocks/_navigation.html.erb index 061989586a..0770e331fd 100644 --- a/app/views/user_blocks/_navigation.html.erb +++ b/app/views/user_blocks/_navigation.html.erb @@ -14,7 +14,7 @@ <% on_user = @user || @user_block&.user %> <% if on_user != current_user && on_user&.blocks&.exists? %> @@ -29,7 +29,7 @@ <% by_user = @user || @user_block&.creator %> <% if by_user != current_user && by_user&.blocks_created&.exists? %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 2a92fbb63c..b190c2ca0b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2925,9 +2925,9 @@ en: navigation: all_blocks: "All Blocks" blocks_on_me: "Blocks on Me" - blocks_on_user: "Blocks on %{user}" + blocks_on_user_html: "Blocks on %{user}" blocks_by_me: "Blocks by Me" - blocks_by_user: "Blocks by %{user}" + blocks_by_user_html: "Blocks by %{user}" block: "Block #%{id}" new_block: "New Block" user_mutes: