From 2d36aa74dbbb29566d2a76c51455b9376bfcc8f2 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Tue, 3 Dec 2024 10:48:59 +0300 Subject: [PATCH] Truncate if necessary and set dir=auto for message usernames --- app/assets/stylesheets/common.scss | 3 ++- app/views/messages/_message_summary.html.erb | 2 +- app/views/messages/_sent_message_summary.html.erb | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index b179ec5ad..cf63c8f8c 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -932,8 +932,9 @@ div.secondary-actions { } } -/* Rules for block pages */ +/* Rules for tables with usernames */ +.messages-table .username, #block_list .username { max-width: 20em; } diff --git a/app/views/messages/_message_summary.html.erb b/app/views/messages/_message_summary.html.erb index a181e96e1..7213cf80d 100644 --- a/app/views/messages/_message_summary.html.erb +++ b/app/views/messages/_message_summary.html.erb @@ -1,5 +1,5 @@ <%= tag.tr(:id => "inbox-#{message.id}", :class => { "table-success" => !message.message_read? }) do %> - <%= link_to message.sender.display_name, user_path(message.sender) %> + <%= link_to message.sender.display_name, user_path(message.sender), :class => "username d-inline-block text-truncate text-wrap align-bottom", :dir => "auto" %> <%= link_to message.title, message_path(message) %> <%= l message.sent_on, :format => :friendly %> diff --git a/app/views/messages/_sent_message_summary.html.erb b/app/views/messages/_sent_message_summary.html.erb index cf10cd462..f744d028a 100644 --- a/app/views/messages/_sent_message_summary.html.erb +++ b/app/views/messages/_sent_message_summary.html.erb @@ -1,5 +1,5 @@ <%= tag.tr(:id => "outbox-#{message.id}") do %> - <%= link_to message.recipient.display_name, user_path(message.recipient) %> + <%= link_to message.recipient.display_name, user_path(message.recipient), :class => "username d-inline-block text-truncate text-wrap align-bottom", :dir => "auto" %> <%= link_to message.title, message_path(message) %> <%= l message.sent_on, :format => :friendly %> -- 2.39.5