[openstreetmap/openstreetmap-website] Adapt notes table to dark mode (PR #4672)

Tobias notifications at github.com
Tue Apr 9 14:02:29 UTC 2024


@tordans commented on this pull request.



> @@ -24,19 +26,20 @@
       </tr>
     </thead>
   <% @notes.each do |note| -%>
-    <tr<% if note.author == @user %> class="table-primary"<% end %>>
-      <td>
+    <% cell_class = submitted_class if note.author == @user -%>
+    <tr>

In https://getbootstrap.com/docs/4.0/content/tables/#contextual-classes it looks like it should be possible to keep the classes on the `tr` which means all the added complexity with `submitted_class` could go away again in favor of inline classes. 
Would something like … be possible? (The code is probably not right, just to illustrate)

```suggestion
    <%= tag.tr :class => ("bg-primary bg-opacity-25" if note.author == @user") do %>
       // td|s
    <% end %>
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4672#pullrequestreview-1989132663
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4672/review/1989132663 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240409/b42f54e7/attachment-0001.htm>


More information about the rails-dev mailing list