From 9e6a25f84443bd7e4da7d58bc1766ec579f5f0ff Mon Sep 17 00:00:00 2001 From: albert Date: Tue, 22 Jan 2013 15:28:12 -0500 Subject: [PATCH] add ubiquitous time tags --- app/helpers/application_helper.rb | 4 ++++ app/helpers/post_appeals_helper.rb | 2 +- app/helpers/post_flags_helper.rb | 2 +- app/views/artist_versions/index.html.erb | 2 +- app/views/comments/partials/show/_comment.html.erb | 2 +- app/views/forum_posts/_forum_post.html.erb | 2 +- app/views/forum_posts/index.html.erb | 2 +- app/views/janitor_trials/index.html.erb | 2 +- .../moderator/dashboards/_activity_user_feedback.html.erb | 2 +- app/views/moderator/post/queues/show.html.erb | 2 +- app/views/notes/index_by_note.html.erb | 2 +- app/views/pool_versions/index.html.erb | 2 +- app/views/posts/partials/show/_information.html.erb | 2 +- app/views/user_feedbacks/index.html.erb | 2 +- app/views/users/index.html.erb | 2 +- app/views/wiki_page_versions/show.html.erb | 2 +- 16 files changed, 19 insertions(+), 15 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index fce5e8e63..bf70ad6cc 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -62,6 +62,10 @@ module ApplicationHelper content_tag(:time, content || datetime, :datetime => datetime, :title => time.to_formatted_s) end + def time_ago_in_words_tagged(time) + time_tag(time_ago_in_words(time) + " ago", time) + end + def compact_time(time) if time > Time.now.end_of_day time_tag(time.strftime("%b %e, %Y"), time) diff --git a/app/helpers/post_appeals_helper.rb b/app/helpers/post_appeals_helper.rb index 956042eac..218072c81 100644 --- a/app/helpers/post_appeals_helper.rb +++ b/app/helpers/post_appeals_helper.rb @@ -4,7 +4,7 @@ module PostAppealsHelper html << '' diff --git a/app/helpers/post_flags_helper.rb b/app/helpers/post_flags_helper.rb index 8f5be3962..c86f58aee 100644 --- a/app/helpers/post_flags_helper.rb +++ b/app/helpers/post_flags_helper.rb @@ -10,7 +10,7 @@ module PostFlagsHelper html << ' - ' + link_to(flag.creator.name, user_path(flag.creator)) end - html << ' ' + time_ago_in_words(flag.created_at) + ' ago' + html << ' ' + time_ago_in_words_tagged(flag.created_at) + ' ago' end html << '' diff --git a/app/views/artist_versions/index.html.erb b/app/views/artist_versions/index.html.erb index 6813c2c9b..484ea1621 100644 --- a/app/views/artist_versions/index.html.erb +++ b/app/views/artist_versions/index.html.erb @@ -21,7 +21,7 @@ <%= link_to h(artist_version.name), artist_versions_path(:artist_id => artist_version.artist_id) %> <%= h artist_version.other_names %> <%= h artist_version.group_name %> - <%= time_ago_in_words artist_version.created_at %> ago + <%= time_ago_in_words_tagged artist_version.created_at %> ago <%= link_to artist_version.updater_name, user_path(artist_version.updater_id) %> <%= artist_version.is_active? %> <%= artist_version.url_string %> diff --git a/app/views/comments/partials/show/_comment.html.erb b/app/views/comments/partials/show/_comment.html.erb index ea930604d..fc0940164 100644 --- a/app/views/comments/partials/show/_comment.html.erb +++ b/app/views/comments/partials/show/_comment.html.erb @@ -2,7 +2,7 @@

<%= link_to comment.creator_name, user_path(comment.creator_id) %>

- <%= time_ago_in_words(comment.created_at) %> ago + <%= time_ago_in_words_tagged(comment.created_at) %> ago

diff --git a/app/views/forum_posts/_forum_post.html.erb b/app/views/forum_posts/_forum_post.html.erb index e328d34e4..014e4bdeb 100644 --- a/app/views/forum_posts/_forum_post.html.erb +++ b/app/views/forum_posts/_forum_post.html.erb @@ -7,7 +7,7 @@ <% end %>

- <%= time_ago_in_words(forum_post.created_at) %> ago + <%= time_ago_in_words_tagged(forum_post.created_at) %> ago

diff --git a/app/views/forum_posts/index.html.erb b/app/views/forum_posts/index.html.erb index 1668bd907..cedc4958e 100644 --- a/app/views/forum_posts/index.html.erb +++ b/app/views/forum_posts/index.html.erb @@ -15,7 +15,7 @@ <%= link_to forum_post.topic.title, forum_topic_path(forum_post.topic) %> <%= link_to truncate(forum_post.body, :length => 50), forum_post_path(forum_post) %> <%= forum_post.creator.name %> - <%= time_ago_in_words forum_post.created_at %> ago + <%= time_ago_in_words_tagged forum_post.created_at %> ago <% end %> diff --git a/app/views/janitor_trials/index.html.erb b/app/views/janitor_trials/index.html.erb index 76fe6fe72..514f9cc37 100644 --- a/app/views/janitor_trials/index.html.erb +++ b/app/views/janitor_trials/index.html.erb @@ -14,7 +14,7 @@ <% @janitor_trials.each do |janitor_trial| %> <%= link_to janitor_trial.user.name, user_path(janitor_trial.user) %> - <%= time_ago_in_words janitor_trial.created_at %> + <%= time_ago_in_words_tagged janitor_trial.created_at %> <%= link_to "Promote", promote_janitor_trial_path(janitor_trial), :remote => true, :method => :put %> | <%= link_to "Demote", demote_janitor_trial_path(janitor_trial), :remote => true, :method => :put %> diff --git a/app/views/moderator/dashboards/_activity_user_feedback.html.erb b/app/views/moderator/dashboards/_activity_user_feedback.html.erb index 56547ed3d..1eeb22a71 100644 --- a/app/views/moderator/dashboards/_activity_user_feedback.html.erb +++ b/app/views/moderator/dashboards/_activity_user_feedback.html.erb @@ -12,7 +12,7 @@ <%= link_to(record.user.name, user_path(record.user)) %> <%= format_text(record.body) %> - <%= time_ago_in_words(record.created_at) %> ago + <%= time_ago_in_words_tagged(record.created_at) %> ago <% end %> diff --git a/app/views/moderator/post/queues/show.html.erb b/app/views/moderator/post/queues/show.html.erb index 46e6e5eab..ac276c3ed 100644 --- a/app/views/moderator/post/queues/show.html.erb +++ b/app/views/moderator/post/queues/show.html.erb @@ -42,7 +42,7 @@ (<%= post.image_width %>x<%= post.image_height %>) <% end %> -
  • Uploader: <%= link_to(post.uploader.name, user_path(post.uploader_id)) %> <%= time_ago_in_words(post.created_at) %> ago
  • +
  • Uploader: <%= link_to(post.uploader.name, user_path(post.uploader_id)) %> <%= time_ago_in_words_tagged(post.created_at) %> ago
  • <% if post.is_flagged? %>
  • Flagged: <%= post_flag_reasons(post) %>
  • <% end %> diff --git a/app/views/notes/index_by_note.html.erb b/app/views/notes/index_by_note.html.erb index b18c32b0b..93d9042d5 100644 --- a/app/views/notes/index_by_note.html.erb +++ b/app/views/notes/index_by_note.html.erb @@ -17,7 +17,7 @@ <%= link_to note.post_id, post_path(note.post_id) %> <%= link_to note.creator.name, user_path(note.creator_id) %> - <%= time_ago_in_words(note.created_at) %> ago + <%= time_ago_in_words_tagged(note.created_at) %> ago <%= note.is_active? %> <%= format_text(note.body) %> diff --git a/app/views/pool_versions/index.html.erb b/app/views/pool_versions/index.html.erb index 56bc57f0c..59cbf81b1 100644 --- a/app/views/pool_versions/index.html.erb +++ b/app/views/pool_versions/index.html.erb @@ -26,7 +26,7 @@ <%= pool_version.updater_ip_addr %> <% end %> - <%= time_ago_in_words pool_version.updated_at %> + <%= time_ago_in_words_tagged pool_version.updated_at %> <%= link_to "Revert", revert_pool_path(pool_version.pool_id, :version => pool_version.id) %> <% end %> diff --git a/app/views/posts/partials/show/_information.html.erb b/app/views/posts/partials/show/_information.html.erb index 54b4755c0..507890f7d 100644 --- a/app/views/posts/partials/show/_information.html.erb +++ b/app/views/posts/partials/show/_information.html.erb @@ -1,6 +1,6 @@