]> git.openstreetmap.org Git - rails.git/commitdiff
Don't use ?: in "Comment from user" changeset discussion strings
authorAnton Khorev <tony29@yandex.ru>
Thu, 19 Sep 2024 12:58:07 +0000 (15:58 +0300)
committerAnton Khorev <tony29@yandex.ru>
Thu, 19 Sep 2024 12:59:03 +0000 (15:59 +0300)
app/views/changesets/show.html.erb

index 13f40ce500d016dee39537330586f908b8287828..a47049e999620a70effb50d2d5edb0a30db41229 100644 (file)
@@ -40,9 +40,9 @@
         <% next unless comment.visible || current_user&.moderator? %>
         <li id="c<%= comment.id %>">
           <small class='text-body-secondary'>
-            <%= t comment.visible ? ".comment_by_html" : ".hidden_comment_by_html",
-                  :time_ago => friendly_date_ago(comment.created_at),
-                  :user => link_to(comment.author.display_name, comment.author) %>
+            <%= comment_by_options = { :time_ago => friendly_date_ago(comment.created_at),
+                                       :user => link_to(comment.author.display_name, comment.author) }
+                comment.visible ? t(".comment_by_html", **comment_by_options) : t(".hidden_comment_by_html", **comment_by_options) %>
             <% if current_user&.moderator? %>
               —
               <%= tag.button t(".#{comment.visible ? 'hide' : 'unhide'}_comment"),