diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 2a451b9..c4dea3a 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -12,8 +12,14 @@ module ApplicationHelper
raw(html)
end
- def time_ago_in_words_label(*args)
- label_tag(nil, time_ago_in_words(*args),
- :title => args.first.strftime("%F %T %z"))
+ def time_ago_in_words_label(time, options = {})
+ strip_about = options.delete(:strip_about)
+ ago = time_ago_in_words(time, options)
+
+ if strip_about
+ ago.gsub!(/^about /, "")
+ end
+
+ raw(label_tag(nil, ago, :title => time.strftime("%F %T %z")))
end
end
diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb
index 5bf877f..0811997 100644
--- a/app/views/comments/_comment.html.erb
+++ b/app/views/comments/_comment.html.erb
@@ -51,8 +51,8 @@ class="comment <%= comment.current_vote ? (comment.current_vote[:vote] == 1 ?
<% elsif comment.is_from_email? %>
e-mailed
<% end %>
- <%= raw(time_ago_in_words_label(comment.has_been_edited? ?
- comment.updated_at : comment.created_at).gsub(/^about /, "")) %> ago
+ <%= time_ago_in_words_label((comment.has_been_edited? ?
+ comment.updated_at : comment.created_at), :strip_about => true) %> ago
<% end %>
<% if !comment.previewing %>
diff --git a/app/views/messages/index.html.erb b/app/views/messages/index.html.erb
index cd0a8d3..cf1bd3c 100644
--- a/app/views/messages/index.html.erb
+++ b/app/views/messages/index.html.erb
@@ -42,7 +42,7 @@
<%=
message.recipient.username %>
<% end %>
-
<%= raw(time_ago_in_words_label(message.created_at)) %> ago |
+ <%= time_ago_in_words_label(message.created_at) %> ago |
<%= message.subject
%> |
diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb
index cc8cf40..d13dae2 100644
--- a/app/views/messages/show.html.erb
+++ b/app/views/messages/show.html.erb
@@ -21,7 +21,7 @@
to
<%=
@message.recipient.username %>
- <%= raw(time_ago_in_words_label(@message.created_at)) %> ago
+ <%= time_ago_in_words_label(@message.created_at) %> ago
diff --git a/app/views/stories/_listdetail.html.erb b/app/views/stories/_listdetail.html.erb
index 54bed76..d36aba7 100644
--- a/app/views/stories/_listdetail.html.erb
+++ b/app/views/stories/_listdetail.html.erb
@@ -54,8 +54,8 @@ class="story <%= story.vote == 1 ? "upvoted" : "" %> <%= story.vote == -1 ?
class="new_user"
<% end %>><%= ms.user.username %>
- <%= raw(time_ago_in_words_label(ms.created_at).gsub(/^about /, ""))
- %> ago
+ <%= time_ago_in_words_label(ms.created_at, :strip_about => true) %>
+ ago
<% end %>
<% end %>
@@ -70,8 +70,8 @@ class="story <%= story.vote == 1 ? "upvoted" : "" %> <%= story.vote == -1 ?
class="new_user"
<% end %>><%= story.user.username %>
- <%= raw(time_ago_in_words_label(story.created_at).gsub(/^about /, ""))
- %> ago
+ <%= time_ago_in_words_label(story.created_at, :strip_about => true) %>
+ ago
<% if story.is_editable_by_user?(@user) %>
|
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 0bd0e96..e15d5d8 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -38,7 +38,7 @@
- <%= raw(time_ago_in_words_label(@showing_user.created_at)) %> ago
+ <%= time_ago_in_words_label(@showing_user.created_at) %> ago
<% if @showing_user.invited_by_user %>
by invitation from
<%= link_to @showing_user.invited_by_user.try(:username),
@@ -50,7 +50,7 @@
<% if @showing_user.is_banned? %>
- <%= raw(time_ago_in_words_label(@showing_user.banned_at)) %> ago
+ <%= time_ago_in_words_label(@showing_user.banned_at) %> ago
<% if @showing_user.banned_by_user %>
by <%= link_to @showing_user.banned_by_user.try(:username),
@showing_user.banned_by_user %>:
@@ -73,7 +73,7 @@
<% if @showing_user.deleted_at? %>
- <%= raw(time_ago_in_words_label(@showing_user.deleted_at)) %> ago
+ <%= time_ago_in_words_label(@showing_user.deleted_at) %> ago
<% end %>