From: Anton Khorev Date: Fri, 11 Aug 2023 17:51:51 +0000 (+0300) Subject: Use flex for buttons cell in messages table X-Git-Tag: live~1183^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/8f946f13607c06df101d26b2b47087b342a29a45?ds=sidebyside;hp=94d8638b00afcf01b37ac293f8e7f94d1cc67695 Use flex for buttons cell in messages table --- diff --git a/app/assets/javascripts/messages.js b/app/assets/javascripts/messages.js index d34ffb466..5accc1a60 100644 --- a/app/assets/javascripts/messages.js +++ b/app/assets/javascripts/messages.js @@ -28,7 +28,7 @@ $(document).ready(function () { $(target).closest("tr") .toggleClass("inbox-row", isRead) .toggleClass("inbox-row-unread", !isRead) - .find(".inbox-mark-unread button").prop("hidden", !isRead).end() - .find(".inbox-mark-read button").prop("hidden", isRead); + .find(".inbox-mark-unread").prop("hidden", !isRead).end() + .find(".inbox-mark-read").prop("hidden", isRead); } }); diff --git a/app/views/messages/_message_summary.html.erb b/app/views/messages/_message_summary.html.erb index 048ded17c..b2a1bc268 100644 --- a/app/views/messages/_message_summary.html.erb +++ b/app/views/messages/_message_summary.html.erb @@ -2,9 +2,9 @@ <%= link_to message_summary.sender.display_name, user_path(message_summary.sender) %> <%= link_to message_summary.title, message_path(message_summary) %> <%= l message_summary.sent_on, :format => :friendly %> - - <%= button_to t(".unread_button"), message_mark_path(message_summary, :mark => "unread"), :remote => true, :class => "btn btn-sm btn-primary", :form_class => "d-inline-block inbox-mark-unread", :hidden => !message_summary.message_read? %> - <%= button_to t(".read_button"), message_mark_path(message_summary, :mark => "read"), :remote => true, :class => "btn btn-sm btn-primary", :form_class => "d-inline-block inbox-mark-read", :hidden => message_summary.message_read? %> - <%= button_to t(".destroy_button"), message_path(message_summary, :referer => request.fullpath), :method => :delete, :remote => true, :class => "btn btn-sm btn-danger", :form_class => "d-inline-block inbox-destroy" %> + + <%= button_to t(".unread_button"), message_mark_path(message_summary, :mark => "unread"), :remote => true, :class => "btn btn-sm btn-primary", :form => { :class => "inbox-mark-unread", :hidden => !message_summary.message_read? } %> + <%= button_to t(".read_button"), message_mark_path(message_summary, :mark => "read"), :remote => true, :class => "btn btn-sm btn-primary", :form => { :class => "inbox-mark-read", :hidden => message_summary.message_read? } %> + <%= button_to t(".destroy_button"), message_path(message_summary, :referer => request.fullpath), :method => :delete, :remote => true, :class => "btn btn-sm btn-danger", :form_class => "inbox-destroy" %> diff --git a/app/views/messages/_sent_message_summary.html.erb b/app/views/messages/_sent_message_summary.html.erb index 374e0861f..24caba5ab 100644 --- a/app/views/messages/_sent_message_summary.html.erb +++ b/app/views/messages/_sent_message_summary.html.erb @@ -2,7 +2,7 @@ <%= link_to sent_message_summary.recipient.display_name, user_path(sent_message_summary.recipient) %> <%= link_to sent_message_summary.title, message_path(sent_message_summary) %> <%= l sent_message_summary.sent_on, :format => :friendly %> - - <%= button_to t(".destroy_button"), message_path(sent_message_summary, :referer => request.fullpath), :method => :delete, :remote => true, :class => "btn btn-sm btn-danger", :form_class => "d-inline-block inbox-destroy" %> + + <%= button_to t(".destroy_button"), message_path(sent_message_summary, :referer => request.fullpath), :method => :delete, :remote => true, :class => "btn btn-sm btn-danger", :form_class => "inbox-destroy" %>