}
}
-/* Rules for messages pages */
-
-.messages {
- .inbox-row-unread td {
- background: #CBEEA7;
- }
-}
-
/* Rules for user images */
img.user_image {
-<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>
<% end %>
</div>
</td>
-</tr>
+<% end %>
-<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>
<%= 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 %>
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
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