Combine last_updated_by and last_updated_at columns on issues index
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 14 Mar 2018 04:50:25 +0000 (12:50 +0800)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 14 Mar 2018 04:51:22 +0000 (12:51 +0800)
Also change to use time as a distance, and link to the user.

app/views/issues/index.html.erb
config/locales/en.yml

index 2980f5e0199d81b4182f37b8e9f2c57c425eb98a..6cb1943937f58dc36bb7d89e6aa9abc3238c7d6b 100644 (file)
@@ -25,8 +25,7 @@
       <td><b><%= t ".reports" %></b></td>
       <td><b><%= t ".reported_item" %></b></td>
       <td><b><%= t ".reported_user" %></b></td>
-      <td><b><%= t ".last_updated_by" %></b></td>
-      <td><b><%= t ".last_updated_at" %></b></td>
+      <td><b><%= t ".last_updated" %></b></td>
     </tr>
   </thead>
   <tbody>
         <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><% if issue.user_updated %> <%= issue.user_updated.display_name %> <% else %> - <% end %></td>
-        <td><%= l(issue.updated_at.to_datetime, :format => :friendly) %></td>
+        <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),
+                                                  :time => distance_of_time_in_words_to_now(issue.updated_at),
+                                                  :title => l(issue.updated_at) %>
+          <% else %>
+            <%= t ".last_updated_time_html", :time => distance_of_time_in_words_to_now(issue.updated_at),
+                                             :title => l(issue.updated_at) %>
+          <% end %>
+        </td>
       </tr>
     <% end %>
   </tbody>
index c508f8e553604fbe942a0cdbf20b0d6f60ce2e9f..65c490e8dcffe8d9dcff12ad966ec5ee04f9aedd 100644 (file)
@@ -980,8 +980,9 @@ en:
       issues_not_found: No such issues found
       status: Status
       reports: Reports
-      last_updated_at: Last Updated At
-      last_updated_by: Last Updated By
+      last_updated: Last Updated
+      last_updated_time_html: "<abbr title='%{title}'>%{time} ago</abbr>"
+      last_updated_time_user_html: "<abbr title='%{title}'>%{time} ago</abbr> by %{user}"
       link_to_reports: View Reports
       reported_user: Reported User
       reports_count: