make time_ago_in_words_label actually do what was intended
This commit is contained in:
parent
6eca23a481
commit
5efe3ce6c3
|
@ -12,8 +12,14 @@ module ApplicationHelper
|
||||||
raw(html)
|
raw(html)
|
||||||
end
|
end
|
||||||
|
|
||||||
def time_ago_in_words_label(*args)
|
def time_ago_in_words_label(time, options = {})
|
||||||
label_tag(nil, time_ago_in_words(*args),
|
strip_about = options.delete(:strip_about)
|
||||||
:title => args.first.strftime("%F %T %z"))
|
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
|
||||||
end
|
end
|
||||||
|
|
|
@ -51,8 +51,8 @@ class="comment <%= comment.current_vote ? (comment.current_vote[:vote] == 1 ?
|
||||||
<% elsif comment.is_from_email? %>
|
<% elsif comment.is_from_email? %>
|
||||||
e-mailed
|
e-mailed
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= raw(time_ago_in_words_label(comment.has_been_edited? ?
|
<%= time_ago_in_words_label((comment.has_been_edited? ?
|
||||||
comment.updated_at : comment.created_at).gsub(/^about /, "")) %> ago
|
comment.updated_at : comment.created_at), :strip_about => true) %> ago
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if !comment.previewing %>
|
<% if !comment.previewing %>
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
<a href="/u/<%= message.recipient.username %>"><%=
|
<a href="/u/<%= message.recipient.username %>"><%=
|
||||||
message.recipient.username %></a>
|
message.recipient.username %></a>
|
||||||
<% end %></td>
|
<% end %></td>
|
||||||
<td><%= raw(time_ago_in_words_label(message.created_at)) %> ago</td>
|
<td><%= time_ago_in_words_label(message.created_at) %> ago</td>
|
||||||
<td><a href="/messages/<%= message.short_id %>"><%= message.subject
|
<td><a href="/messages/<%= message.short_id %>"><%= message.subject
|
||||||
%></a></td>
|
%></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
to
|
to
|
||||||
<a href="/u/<%= @message.recipient.username %>"><%=
|
<a href="/u/<%= @message.recipient.username %>"><%=
|
||||||
@message.recipient.username %></a>
|
@message.recipient.username %></a>
|
||||||
<%= raw(time_ago_in_words_label(@message.created_at)) %> ago
|
<%= time_ago_in_words_label(@message.created_at) %> ago
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -54,8 +54,8 @@ class="story <%= story.vote == 1 ? "upvoted" : "" %> <%= story.vote == -1 ?
|
||||||
class="new_user"
|
class="new_user"
|
||||||
<% end %>><%= ms.user.username %></a>
|
<% end %>><%= ms.user.username %></a>
|
||||||
|
|
||||||
<%= raw(time_ago_in_words_label(ms.created_at).gsub(/^about /, ""))
|
<%= time_ago_in_words_label(ms.created_at, :strip_about => true) %>
|
||||||
%> ago
|
ago
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -70,8 +70,8 @@ class="story <%= story.vote == 1 ? "upvoted" : "" %> <%= story.vote == -1 ?
|
||||||
class="new_user"
|
class="new_user"
|
||||||
<% end %>><%= story.user.username %></a>
|
<% end %>><%= story.user.username %></a>
|
||||||
|
|
||||||
<%= raw(time_ago_in_words_label(story.created_at).gsub(/^about /, ""))
|
<%= time_ago_in_words_label(story.created_at, :strip_about => true) %>
|
||||||
%> ago
|
ago
|
||||||
|
|
||||||
<% if story.is_editable_by_user?(@user) %>
|
<% if story.is_editable_by_user?(@user) %>
|
||||||
|
|
|
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
<label class="required">Joined:</label>
|
<label class="required">Joined:</label>
|
||||||
<span class="d">
|
<span class="d">
|
||||||
<%= 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 %>
|
<% if @showing_user.invited_by_user %>
|
||||||
by invitation from
|
by invitation from
|
||||||
<%= link_to @showing_user.invited_by_user.try(:username),
|
<%= link_to @showing_user.invited_by_user.try(:username),
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
<% if @showing_user.is_banned? %>
|
<% if @showing_user.is_banned? %>
|
||||||
<label class="required">Banned:</label>
|
<label class="required">Banned:</label>
|
||||||
<span class="d">
|
<span class="d">
|
||||||
<%= 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 %>
|
<% if @showing_user.banned_by_user %>
|
||||||
by <%= link_to @showing_user.banned_by_user.try(:username),
|
by <%= link_to @showing_user.banned_by_user.try(:username),
|
||||||
@showing_user.banned_by_user %>:
|
@showing_user.banned_by_user %>:
|
||||||
|
@ -73,7 +73,7 @@
|
||||||
<% if @showing_user.deleted_at? %>
|
<% if @showing_user.deleted_at? %>
|
||||||
<label class="required">Left:</label>
|
<label class="required">Left:</label>
|
||||||
<span class="d">
|
<span class="d">
|
||||||
<%= raw(time_ago_in_words_label(@showing_user.deleted_at)) %> ago
|
<%= time_ago_in_words_label(@showing_user.deleted_at) %> ago
|
||||||
</span>
|
</span>
|
||||||
<br>
|
<br>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in a new issue