add ubiquitous time tags

This commit is contained in:
albert
2013-01-22 15:28:12 -05:00
parent c163139390
commit 9e6a25f844
16 changed files with 19 additions and 15 deletions

View File

@@ -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)

View File

@@ -4,7 +4,7 @@ module PostAppealsHelper
html << '<ul>'
post.appeals.each do |appeal|
html << '<li>' + appeal.reason + ' - ' + link_to(appeal.creator.name, user_path(appeal.creator)) + ' ' + time_ago_in_words(appeal.created_at) + ' ago</li>'
html << '<li>' + appeal.reason + ' - ' + link_to(appeal.creator.name, user_path(appeal.creator)) + ' ' + time_ago_in_words_tagged(appeal.created_at) + ' ago</li>'
end
html << '</ul>'

View File

@@ -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</li>'
html << ' ' + time_ago_in_words_tagged(flag.created_at) + ' ago</li>'
end
html << '</ul>'