Merge remote-tracking branch 'upstream/pull/4703'

This commit is contained in:
Tom Hughes 2024-04-23 17:20:08 +01:00
commit f99d7374a9
5 changed files with 16 additions and 19 deletions

View file

@ -75,7 +75,10 @@ time[title] {
.table-secondary {
--bs-table-bg: rgb(var(--bs-secondary-rgb), .25);
}
.table-primary, .table-secondary {
.table-success {
--bs-table-bg: rgb(var(--bs-success-rgb), .25);
}
.table-primary, .table-secondary, .table-success {
--bs-table-color: initial;
border-color: inherit;
}
@ -812,14 +815,6 @@ tr.turn {
}
}
/* Rules for messages pages */
.messages {
.inbox-row-unread td {
background: #CBEEA7;
}
}
/* Rules for user images */
img.user_image {

View file

@ -19,4 +19,6 @@ $link-hover-color: #24d;
$link-decoration: none;
$link-hover-decoration: underline;
$table-border-factor: .1;
$enable-negative-margins: true;

View file

@ -1,4 +1,4 @@
<tr id="inbox-<%= message.id %>" class="message-summary inbox-row<%= "-unread" unless message.message_read? %>">
<%= tag.tr(:id => "inbox-#{message.id}", :class => { "message-summary" => true, "table-success" => !message.message_read? }) do %>
<td><%= link_to message.sender.display_name, user_path(message.sender) %></td>
<td><%= link_to message.title, message_path(message) %></td>
<td class="text-nowrap"><%= l message.sent_on, :format => :friendly %></td>
@ -12,4 +12,4 @@
<% end %>
</div>
</td>
</tr>
<% end %>

View file

@ -1,4 +1,4 @@
<tr id="outbox-<%= message.id %>" class="message-summary inbox-row">
<%= tag.tr(:id => "outbox-#{message.id}", :class => { "message-summary" => true }) do %>
<td><%= link_to message.recipient.display_name, user_path(message.recipient) %></td>
<td><%= link_to message.title, message_path(message) %></td>
<td class="text-nowrap"><%= l message.sent_on, :format => :friendly %></td>
@ -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" } %>
</div>
</td>
</tr>
<% end %>

View file

@ -339,9 +339,9 @@ class MessagesControllerTest < ActionDispatch::IntegrationTest
get inbox_messages_path
assert_response :success
assert_template "inbox"
assert_select ".content-inner > table", :count => 1 do
assert_select "tr", :count => 2
assert_select "tr#inbox-#{read_message.id}.inbox-row", :count => 1 do
assert_select ".content-inner > table.messages-table > tbody", :count => 1 do
assert_select "tr", :count => 1
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
@ -365,9 +365,9 @@ class MessagesControllerTest < ActionDispatch::IntegrationTest
get outbox_messages_path
assert_response :success
assert_template "outbox"
assert_select ".content-inner > table", :count => 1 do
assert_select "tr", :count => 2
assert_select "tr.inbox-row", :count => 1 do
assert_select ".content-inner > table.messages-table > tbody", :count => 1 do
assert_select "tr", :count => 1
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