]> git.openstreetmap.org Git - rails.git/commitdiff
Simplify date display by using friendly_date helpers
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 15 Nov 2023 19:46:10 +0000 (19:46 +0000)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 15 Nov 2023 19:46:10 +0000 (19:46 +0000)
app/views/browse/_common_details.html.erb
app/views/diary_entries/comments.html.erb
app/views/issues/index.html.erb
app/views/traces/_trace.html.erb

index 9eb6b5bfe55988f76d99e1487012cb9c3b619158..4726799e7342966a5c018d1fe93fbaba4f225825 100644 (file)
@@ -14,8 +14,7 @@
 <ul class="list-unstyled">
   <li>
     <%= t "browse.#{common_details.visible? ? :edited : :deleted}_ago_by_html",
-          :time_ago => tag.abbr(time_ago_in_words(common_details.timestamp, :scope => :"datetime.distance_in_words_ago"),
-                                :title => l(common_details.timestamp)),
+          :time_ago => friendly_date_ago(common_details.timestamp),
           :user => changeset_user_link(common_details.changeset) %>
   </li>
   <li>
index f82373af0c5558d7678ec0df78e7f90aa7b959f3..61ceccdc06635cc07ffd2a0f317cc51a2fe2a8e2 100644 (file)
@@ -18,7 +18,9 @@
     <% @comments.each do |comment| -%>
     <tr>
       <td width="25%" class="<%= "text-muted" unless comment.visible? %>"><%= link_to comment.diary_entry.title, diary_entry_path(comment.diary_entry.user, comment.diary_entry) %></td>
-      <td width="25%" class="<%= "text-muted" unless comment.visible? %>"><span title="<%= l comment.created_at, :format => :friendly %>"><%= time_ago_in_words(comment.created_at, :scope => :"datetime.distance_in_words_ago") %></span></td>
+      <td width="25%" class="<%= "text-muted" unless comment.visible? %>">
+        <%= friendly_date_ago(comment.created_at) %>
+      </td>
       <td width="50%" class="richtext text-break<%= " text-muted" unless comment.visible? %>"><%= comment.body.to_html %></td>
     </tr>
     <% end -%>
index da00b5fea27a8455fdd1b0951feb26070bff511d..12ddf2b32a162f6e77c909eb4458dbd9a771571f 100644 (file)
           <td><%= link_to reportable_title(issue.reportable), reportable_url(issue.reportable) %></td>
           <td><%= link_to issue.reported_user.display_name, user_path(issue.reported_user) if issue.reported_user %></td>
           <td>
-            <% time_ago_tag = tag.abbr(time_ago_in_words(issue.updated_at, :scope => :"datetime.distance_in_words_ago"),
-                                       :title => l(issue.updated_at)) %>
             <% if issue.user_updated %>
               <%= t ".last_updated_time_ago_user_html", :user => link_to(issue.user_updated.display_name, user_path(issue.user_updated)),
-                                                        :time_ago => time_ago_tag %>
+                                                        :time_ago => friendly_date_ago(issue.updated_at) %>
             <% else %>
-              <%= time_ago_tag %>
+              <%= friendly_date_ago(issue.updated_at) %>
             <% end %>
           </td>
         </tr>
index 832187b79306acda89b58896a595daf054b01ca7..9ee58cf22122beff7633c1f02bd71c73f5c67e73 100644 (file)
@@ -29,9 +29,7 @@
       </li>
     </ul>
     <p class="text-muted mb-0">
-      <span title="<%= trace.timestamp %>">
-        <%= time_ago_in_words(trace.timestamp, :scope => :"datetime.distance_in_words_ago") %>
-      </span>
+      <%= friendly_date_ago(trace.timestamp) %>
       <%= t ".by" %> <%= link_to trace.user.display_name, user_path(trace.user) %>
       <% if !trace.tags.empty? %>
         <%= t ".in" %>