]> git.openstreetmap.org Git - rails.git/commitdiff
User user_path to generate links to users
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 14 Mar 2018 06:21:43 +0000 (14:21 +0800)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 14 Mar 2018 06:21:43 +0000 (14:21 +0800)
app/views/issues/_comments.html.erb
app/views/issues/_reports.html.erb
app/views/issues/index.html.erb
config/locales/en.yml

index ec885aa8c824a22d7366d42cc73d51684eed683e..e423714659a80285d6508059861e63b2d8301aac 100644 (file)
@@ -2,9 +2,9 @@
   <% comments.each do |comment| %>
     <div class="comment">
       <div style="float:left">
   <% comments.each do |comment| %>
     <div class="comment">
       <div style="float:left">
-        <%= link_to user_thumbnail(comment.user), :controller => :user, :action =>:view, :display_name => comment.user.display_name %>
+        <%= link_to user_thumbnail(comment.user), user_path(comment.user.display_name) %>
       </div>
       </div>
-      <b> <%= link_to comment.user.display_name, :controller => :user, :action =>:view, :display_name => comment.user.display_name %> </b> <br/>
+      <b> <%= link_to comment.user.display_name, user_path(comment.user.display_name) %> </b> <br/>
       <%= comment.body %>
     </div>
     <span class="deemphasize">
       <%= comment.body %>
     </div>
     <span class="deemphasize">
index 01c34efe1a5631de6e650946c63f3bfc198864ad..51643a6af20162b6d8cd466bf65cd80a99c712dd 100644 (file)
@@ -1,9 +1,10 @@
 <% reports.each do |report| %>
   <div class="reports">
     <div style="float:left">
 <% reports.each do |report| %>
   <div class="reports">
     <div style="float:left">
-      <%= link_to user_thumbnail(report.user), :controller => :user, :action =>:view, :display_name => report.user.display_name %>
+      <%= link_to user_thumbnail(report.user), user_path(report.user.display_name) %>
     </div>
     </div>
-    <%= t(".reported_by_html", :category => report.category, :user_name => report.user.display_name, :user_url => url_for(:controller => :user, :action => :view, :display_name => report.user.display_name)) %> <br/>
+    <%= t ".reported_by_html", :category => report.category, :user => link_to(report.user.display_name, user_path(report.user.display_name)) %>
+    <br/>
     <span class="deemphasize">
       <%= t(".updated_at", :datetime => l(report.updated_at.to_datetime, :format => :friendly)) %>
     </span>
     <span class="deemphasize">
       <%= t(".updated_at", :datetime => l(report.updated_at.to_datetime, :format => :friendly)) %>
     </span>
index 53927701ec527c91eb3a31c78f4c7e4df0f45297..30b283324822c39ca693fc0c10f7dc03facc2a0e 100644 (file)
         <td><%= t "issues.states.#{issue.status}" %></td>
         <td><%= link_to t(".reports_count", :count => issue.reports_count), issue %></td>
         <td><%= link_to reportable_title(issue.reportable), reportable_url(issue.reportable) %></td>
         <td><%= t "issues.states.#{issue.status}" %></td>
         <td><%= 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, :controller => :user, :action => :view, :display_name => issue.reported_user.display_name if issue.reported_user %></td>
+        <td><%= link_to issue.reported_user.display_name, user_path(issue.reported_user.display_name) if issue.reported_user %></td>
         <td>
           <% if issue.user_updated %>
         <td>
           <% if issue.user_updated %>
-            <%= t ".last_updated_time_user_html", :user => link_to(issue.user_updated.display_name, :controller => :user, :action => :view, :display_name => issue.user_updated.display_name),
+            <%= t ".last_updated_time_user_html", :user => link_to(issue.user_updated.display_name, user_path(issue.user_updated.display_name)),
                                                   :time => distance_of_time_in_words_to_now(issue.updated_at),
                                                   :title => l(issue.updated_at) %>
           <% else %>
                                                   :time => distance_of_time_in_words_to_now(issue.updated_at),
                                                   :title => l(issue.updated_at) %>
           <% else %>
index 65c490e8dcffe8d9dcff12ad966ec5ee04f9aedd..2466561b4349f1a88657915f36d4bd8b1bb16a37 100644 (file)
@@ -1028,7 +1028,7 @@ en:
       created_at: "On %{datetime}"
     reports:
       updated_at: "On %{datetime}"
       created_at: "On %{datetime}"
     reports:
       updated_at: "On %{datetime}"
-      reported_by_html: "Reported as %{category} by <a href=\"%{user_url}\">%{user_name}</a>"
+      reported_by_html: "Reported as %{category} by %{user}"
     resolved: Issue status has been set to 'Resolved'
     ignored: Issue status has been set to 'Ignored'
     reopened: Issue status has been set to 'Open'
     resolved: Issue status has been set to 'Resolved'
     ignored: Issue status has been set to 'Ignored'
     reopened: Issue status has been set to 'Open'