From: Anton Khorev Date: Mon, 15 Apr 2024 01:04:30 +0000 (+0300) Subject: Remove .inbox-row and use .table-success instead of .inbox-row-unread X-Git-Tag: live~613^2~2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/fdd596bd6024ccf6710fc922f996f7e30041652d Remove .inbox-row and use .table-success instead of .inbox-row-unread --- diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 549226f58..b949e8ac1 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -810,14 +810,6 @@ tr.turn { } } -/* Rules for messages pages */ - -.messages { - .inbox-row-unread td { - background: #CBEEA7; - } -} - /* Rules for user images */ img.user_image { diff --git a/app/views/messages/_message_summary.html.erb b/app/views/messages/_message_summary.html.erb index 02c60a752..1a7a0c839 100644 --- a/app/views/messages/_message_summary.html.erb +++ b/app/views/messages/_message_summary.html.erb @@ -1,4 +1,4 @@ -"> +<%= tag.tr(:id => "inbox-#{message.id}", :class => { "message-summary" => true, "table-success" => !message.message_read? }) do %> <%= link_to message.sender.display_name, user_path(message.sender) %> <%= link_to message.title, message_path(message) %> <%= l message.sent_on, :format => :friendly %> @@ -12,4 +12,4 @@ <% end %> - +<% end %> diff --git a/app/views/messages/_sent_message_summary.html.erb b/app/views/messages/_sent_message_summary.html.erb index 82bbafc16..cd156aa47 100644 --- a/app/views/messages/_sent_message_summary.html.erb +++ b/app/views/messages/_sent_message_summary.html.erb @@ -1,4 +1,4 @@ - +<%= tag.tr(:id => "outbox-#{message.id}", :class => { "message-summary" => true }) do %> <%= link_to message.recipient.display_name, user_path(message.recipient) %> <%= link_to message.title, message_path(message) %> <%= l message.sent_on, :format => :friendly %> @@ -7,4 +7,4 @@ <%= button_to t(".destroy_button"), message_path(message, :referer => request.fullpath), :method => :delete, :class => "btn btn-sm btn-danger", :form => { :data => { :turbo => true }, :class => "destroy-message" } %> - +<% end %> diff --git a/test/controllers/messages_controller_test.rb b/test/controllers/messages_controller_test.rb index 5ef0233bf..dfec6346f 100644 --- a/test/controllers/messages_controller_test.rb +++ b/test/controllers/messages_controller_test.rb @@ -341,7 +341,7 @@ class MessagesControllerTest < ActionDispatch::IntegrationTest assert_template "inbox" assert_select ".content-inner > table.messages-table > tbody", :count => 1 do assert_select "tr", :count => 1 - assert_select "tr#inbox-#{read_message.id}.inbox-row", :count => 1 do + assert_select "tr#inbox-#{read_message.id}", :count => 1 do assert_select "a[href='#{user_path read_message.sender}']", :text => read_message.sender.display_name assert_select "a[href='#{message_path read_message}']", :text => read_message.title end @@ -367,7 +367,7 @@ class MessagesControllerTest < ActionDispatch::IntegrationTest assert_template "outbox" assert_select ".content-inner > table.messages-table > tbody", :count => 1 do assert_select "tr", :count => 1 - assert_select "tr.inbox-row", :count => 1 do + assert_select "tr#outbox-#{message.id}", :count => 1 do assert_select "a[href='#{user_path message.recipient}']", :text => message.recipient.display_name assert_select "a[href='#{message_path message}']", :text => message.title end