Wrap message action buttons in divs

Avoid redefining table cell display css property using d-flex. Now d-flex is on wrapper divs.
This commit is contained in:
Anton Khorev 2024-04-15 03:14:00 +03:00
parent 28a39c645f
commit 5befc0658a
2 changed files with 13 additions and 9 deletions

View file

@ -2,12 +2,14 @@
<td><%= link_to message.sender.display_name, user_path(message.sender) %></td> <td><%= link_to message.sender.display_name, user_path(message.sender) %></td>
<td><%= link_to message.title, message_path(message) %></td> <td><%= link_to message.title, message_path(message) %></td>
<td class="text-nowrap"><%= l message.sent_on, :format => :friendly %></td> <td class="text-nowrap"><%= l message.sent_on, :format => :friendly %></td>
<td class="text-nowrap d-flex justify-content-end gap-1"> <td class="text-nowrap">
<div class="d-flex justify-content-end gap-1">
<%= button_to t(".unread_button"), message_mark_path(message, :mark => "unread"), :class => "btn btn-sm btn-primary", :form => { :data => { :turbo => true }, :class => "inbox-mark-unread", :hidden => !message.message_read? } %> <%= button_to t(".unread_button"), message_mark_path(message, :mark => "unread"), :class => "btn btn-sm btn-primary", :form => { :data => { :turbo => true }, :class => "inbox-mark-unread", :hidden => !message.message_read? } %>
<%= button_to t(".read_button"), message_mark_path(message, :mark => "read"), :class => "btn btn-sm btn-primary", :form => { :data => { :turbo => true }, :class => "inbox-mark-read", :hidden => message.message_read? } %> <%= button_to t(".read_button"), message_mark_path(message, :mark => "read"), :class => "btn btn-sm btn-primary", :form => { :data => { :turbo => true }, :class => "inbox-mark-read", :hidden => message.message_read? } %>
<%= 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" } %> <%= 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" } %>
<% if message.muted? %> <% if message.muted? %>
<%= button_to t(".unmute_button"), message_unmute_path(message), :method => :patch, :class => "btn btn-sm btn-secondary", :form => { :data => { :turbo => true } } %> <%= button_to t(".unmute_button"), message_unmute_path(message), :method => :patch, :class => "btn btn-sm btn-secondary", :form => { :data => { :turbo => true } } %>
<% end %> <% end %>
</div>
</td> </td>
</tr> </tr>

View file

@ -2,7 +2,9 @@
<td><%= link_to message.recipient.display_name, user_path(message.recipient) %></td> <td><%= link_to message.recipient.display_name, user_path(message.recipient) %></td>
<td><%= link_to message.title, message_path(message) %></td> <td><%= link_to message.title, message_path(message) %></td>
<td class="text-nowrap"><%= l message.sent_on, :format => :friendly %></td> <td class="text-nowrap"><%= l message.sent_on, :format => :friendly %></td>
<td class="text-nowrap d-flex justify-content-end gap-1"> <td class="text-nowrap">
<div class="d-flex justify-content-end gap-1">
<%= 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" } %> <%= 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" } %>
</div>
</td> </td>
</tr> </tr>