From: Andy Allan Date: Wed, 19 Jun 2019 10:16:04 +0000 (+0200) Subject: Update note comments to use friendly_date_ago helper X-Git-Tag: live~2558^2 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/23dfc4d3bde49ef907de08ee2efbece0d4ce261d?ds=sidebyside Update note comments to use friendly_date_ago helper Refs #2255 --- diff --git a/app/views/api/notes/_comment.html.erb b/app/views/api/notes/_comment.html.erb index d9c17848b..f599eec14 100644 --- a/app/views/api/notes/_comment.html.erb +++ b/app/views/api/notes/_comment.html.erb @@ -1,8 +1,8 @@
<% if comment.author.nil? -%> -
<%= t ".#{comment.event}_at_html", :when => friendly_date(comment.created_at) %>
+
<%= t ".#{comment.event}_at_html", :when => friendly_date_ago(comment.created_at) %>
<% else -%> -
<%= t ".#{comment.event}_at_by_html", :when => friendly_date(comment.created_at), :user => note_author(comment.author, :only_path => false) %>
+
<%= t ".#{comment.event}_at_by_html", :when => friendly_date_ago(comment.created_at), :user => note_author(comment.author, :only_path => false) %>
<% end -%>
<%= comment.body %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index 8a6a97dc8..1de83f9d6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -163,14 +163,14 @@ en: api: notes: comment: - opened_at_html: "Created %{when} ago" - opened_at_by_html: "Created %{when} ago by %{user}" - commented_at_html: "Updated %{when} ago" - commented_at_by_html: "Updated %{when} ago by %{user}" - closed_at_html: "Resolved %{when} ago" - closed_at_by_html: "Resolved %{when} ago by %{user}" - reopened_at_html: "Reactivated %{when} ago" - reopened_at_by_html: "Reactivated %{when} ago by %{user}" + opened_at_html: "Created %{when}" + opened_at_by_html: "Created %{when} by %{user}" + commented_at_html: "Updated %{when}" + commented_at_by_html: "Updated %{when}by %{user}" + closed_at_html: "Resolved %{when}" + closed_at_by_html: "Resolved %{when} by %{user}" + reopened_at_html: "Reactivated %{when}" + reopened_at_by_html: "Reactivated %{when} by %{user}" rss: title: "OpenStreetMap Notes" description_area: "A list of notes, reported, commented on or closed in your area [(%{min_lat}|%{min_lon}) -- (%{max_lat}|%{max_lon})]"