]> git.openstreetmap.org Git - rails.git/commitdiff
Simplify link_to user calls on issue pages
authorAnton Khorev <tony29@yandex.ru>
Wed, 20 Mar 2024 01:38:34 +0000 (04:38 +0300)
committerAnton Khorev <tony29@yandex.ru>
Wed, 20 Mar 2024 01:38:34 +0000 (04:38 +0300)
app/views/issues/_comments.html.erb
app/views/issues/_reports.html.erb
app/views/issues/index.html.erb
app/views/issues/show.html.erb

index 7776d9ee398a89077a3899b1bbe9a79d83ece820..9200b4cec6246b8feebcc7dbaab1eee77fe19a43 100644 (file)
@@ -2,11 +2,11 @@
   <% comments.each do |comment| %>
     <div class="row">
       <div class="col-auto">
-        <%= link_to user_thumbnail(comment.user), user_path(comment.user) %>
+        <%= link_to user_thumbnail(comment.user), comment.user %>
       </div>
       <div class="col">
         <p class="text-muted">
-          <%= t ".comment_from_html", :user_link => link_to(comment.user.display_name, user_path(comment.user)),
+          <%= t ".comment_from_html", :user_link => link_to(comment.user.display_name, comment.user),
                                       :comment_created_at => tag.time(l(comment.created_at.to_datetime, :format => :friendly),
                                                                       :datetime => comment.created_at.xmlschema) %>
         </p>
index 9ef28f1c29007c06664aed58894350b90fcc0081..2d1b78800688bcb17d024b1d603c83fed890dd36 100644 (file)
@@ -1,12 +1,12 @@
 <% reports.each do |report| %>
   <div class="row">
     <div class="col-auto">
-      <%= link_to user_thumbnail(report.user), user_path(report.user) %>
+      <%= link_to user_thumbnail(report.user), report.user %>
     </div>
     <div class="col">
       <p class="text-muted">
         <%= t ".reported_by_html", :category => report.category,
-                                   :user => link_to(report.user.display_name, user_path(report.user)),
+                                   :user => link_to(report.user.display_name, report.user),
                                    :updated_at => tag.time(l(report.updated_at.to_datetime, :format => :friendly),
                                                            :datetime => report.updated_at.xmlschema) %>
       </p>
index 12ddf2b32a162f6e77c909eb4458dbd9a771571f..523f90846a1a35a4e459dddce6a445c72fca0ad9 100644 (file)
           <td><%= t ".states.#{issue.status}" %></td>
           <td class="text-nowrap"><%= link_to t(".reports_count", :count => issue.reports_count), issue %></td>
           <td><%= link_to reportable_title(issue.reportable), reportable_url(issue.reportable) %></td>
-          <td><%= link_to issue.reported_user.display_name, user_path(issue.reported_user) if issue.reported_user %></td>
+          <td><%= link_to issue.reported_user.display_name, issue.reported_user if issue.reported_user %></td>
           <td>
             <% if issue.user_updated %>
-              <%= t ".last_updated_time_ago_user_html", :user => link_to(issue.user_updated.display_name, user_path(issue.user_updated)),
+              <%= t ".last_updated_time_ago_user_html", :user => link_to(issue.user_updated.display_name, issue.user_updated),
                                                         :time_ago => friendly_date_ago(issue.updated_at) %>
             <% else %>
               <%= friendly_date_ago(issue.updated_at) %>
index e2099f8e6878cab075faf7657940676d408bfb42..8b5f7f42d222d8f6903e199cbce64b2ddeeb7ddb 100644 (file)
@@ -21,7 +21,7 @@
       | <%= t ".last_updated_at_html",
               :datetime => tag.time(l(@issue.updated_at.to_datetime, :format => :friendly),
                                     :datetime => @issue.updated_at.xmlschema),
-              :displayname => link_to(@issue.user_updated.display_name, user_path(@issue.user_updated)) %>
+              :displayname => link_to(@issue.user_updated.display_name, @issue.user_updated) %>
     <% end %>
   </small>
 </p>