[openstreetmap/openstreetmap-website] Replace submitted note table colors with created/resolved (PR #5269)

David Tsiklauri notifications at github.com
Fri Feb 21 09:15:39 UTC 2025


@nertc commented on this pull request.

Tested and works perfectly for all kinds of situations. I like the last solution that UI watches only author and the last comment. It provides intuitive UI/UX.

> @@ -24,7 +26,15 @@
       </tr>
     </thead>
   <% @notes.each do |note| -%>
-    <tr<% if note.author == @user %> class="table-primary"<% end %>>
+    <% opened_by_user = note.author == @user %>
+    <% closed_by_user = note.comments.last&.author == @user && note.comments.last&.event == "closed" %>

As I checked, mostly variables created in the `.html.erb` files directly have meaning of either class, id or other values that are only related to the UI and not to the logic. Is it okay for this project to have variables that are intermediate logical elements and don't have direct value of class, id or other strings like that?

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

Message ID: <openstreetmap/openstreetmap-website/pull/5269/review/2632444055 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250221/ca1ff6c3/attachment.htm>


More information about the rails-dev mailing list