Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/pull/4703'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Apr 23, 2024
2 parents c62b8b2 + 20d0551 commit f99d737
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
13 changes: 4 additions & 9 deletions app/assets/stylesheets/common.scss
Expand Up @@ -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;
}
Expand Down Expand Up @@ -812,14 +815,6 @@ tr.turn {
}
}

/* Rules for messages pages */

.messages {
.inbox-row-unread td {
background: #CBEEA7;
}
}

/* Rules for user images */

img.user_image {
Expand Down
2 changes: 2 additions & 0 deletions app/assets/stylesheets/parameters.scss
Expand Up @@ -19,4 +19,6 @@ $link-hover-color: #24d;
$link-decoration: none;
$link-hover-decoration: underline;

$table-border-factor: .1;

$enable-negative-margins: true;
4 changes: 2 additions & 2 deletions app/views/messages/_message_summary.html.erb
@@ -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>
Expand All @@ -12,4 +12,4 @@
<% end %>
</div>
</td>
</tr>
<% end %>
4 changes: 2 additions & 2 deletions app/views/messages/_sent_message_summary.html.erb
@@ -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>
Expand All @@ -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 %>
12 changes: 6 additions & 6 deletions test/controllers/messages_controller_test.rb
Expand Up @@ -339,9 +339,9 @@ def test_inbox
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
Expand All @@ -365,9 +365,9 @@ def test_outbox
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
Expand Down

0 comments on commit f99d737

Please sign in to comment.