From aaaeb211dea4711fd6bff4d79c1339e82a43ebcd Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 14 Mar 2018 12:50:25 +0800 Subject: [PATCH] Combine last_updated_by and last_updated_at columns on issues index Also change to use time as a distance, and link to the user. --- app/views/issues/index.html.erb | 15 +++++++++++---- config/locales/en.yml | 5 +++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 2980f5e01..6cb194393 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -25,8 +25,7 @@ <%= t ".reports" %> <%= t ".reported_item" %> <%= t ".reported_user" %> - <%= t ".last_updated_by" %> - <%= t ".last_updated_at" %> + <%= t ".last_updated" %> @@ -36,8 +35,16 @@ <%= link_to t(".reports_count", :count => issue.reports_count), issue %> <%= link_to reportable_title(issue.reportable), reportable_url(issue.reportable) %> <%= link_to issue.reported_user.display_name, :controller => :user, :action => :view, :display_name => issue.reported_user.display_name if issue.reported_user %> - <% if issue.user_updated %> <%= issue.user_updated.display_name %> <% else %> - <% end %> - <%= l(issue.updated_at.to_datetime, :format => :friendly) %> + + <% 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 %> + <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index c508f8e55..65c490e8d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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: "%{time} ago" + last_updated_time_user_html: "%{time} ago by %{user}" link_to_reports: View Reports reported_user: Reported User reports_count: -- 2.45.1