From 00f75c175e432e51c7c80eff02384dc35294d760 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 19 Jun 2019 11:36:09 +0200 Subject: [PATCH] Use scope for common details and changeset display in browse pages Refs #2255 --- app/helpers/changesets_helper.rb | 4 ++-- app/views/browse/_common_details.html.erb | 2 +- config/locales/en.yml | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/helpers/changesets_helper.rb b/app/helpers/changesets_helper.rb index 4a327c16c..97a70f789 100644 --- a/app/helpers/changesets_helper.rb +++ b/app/helpers/changesets_helper.rb @@ -12,11 +12,11 @@ module ChangesetsHelper def changeset_details(changeset) if changeset.closed_at > Time.now action = :created - time = distance_of_time_in_words_to_now(changeset.created_at) + time = time_ago_in_words(changeset.created_at, :scope => :'datetime.distance_in_words_ago') title = l(changeset.created_at) else action = :closed - time = distance_of_time_in_words_to_now(changeset.closed_at) + time = time_ago_in_words(changeset.closed_at, :scope => :'datetime.distance_in_words_ago') title = "#{t('browse.created')}: #{l(changeset.created_at)} #{t('browse.closed')}: #{l(changeset.closed_at)}".html_safe end diff --git a/app/views/browse/_common_details.html.erb b/app/views/browse/_common_details.html.erb index 44bbe04f8..1c8f1c5da 100644 --- a/app/views/browse/_common_details.html.erb +++ b/app/views/browse/_common_details.html.erb @@ -8,7 +8,7 @@
<%= t "browse.#{common_details.visible? ? :edited : :deleted}_by_html", - :time => distance_of_time_in_words_to_now(common_details.timestamp), + :time => time_ago_in_words(common_details.timestamp, :scope => :'datetime.distance_in_words_ago'), :user => changeset_user_link(common_details.changeset), :title => l(common_details.timestamp) %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index b714e96cd..897e5f7c0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -185,12 +185,12 @@ en: browse: created: "Created" closed: "Closed" - created_html: "Created %{time} ago" - closed_html: "Closed %{time} ago" - created_by_html: "Created %{time} ago by %{user}" - deleted_by_html: "Deleted %{time} ago by %{user}" - edited_by_html: "Edited %{time} ago by %{user}" - closed_by_html: "Closed %{time} ago by %{user}" + created_html: "Created %{time}" + closed_html: "Closed %{time}" + created_by_html: "Created %{time} by %{user}" + deleted_by_html: "Deleted %{time} by %{user}" + edited_by_html: "Edited %{time} by %{user}" + closed_by_html: "Closed %{time} by %{user}" version: "Version" in_changeset: "Changeset" anonymous: "anonymous" -- 2.39.5