#1480 项目留言区回复时间显示问题

Homework
z9hang 11 years ago
parent 6964a787b2
commit 9bd1af9541

@ -578,12 +578,13 @@ module ApplicationHelper
return ss return ss
end end
def time_tag(time) def time_tag(time, *args)
options = args.extract_options!
text = distance_of_time_in_words(Time.now, time) text = distance_of_time_in_words(Time.now, time)
if @project if @project
link_to(text, {:controller => 'activities', :action => 'index', :id => @project, :from => User.current.time_to_date(time)}, :title => format_time(time)) link_to(text, {:controller => 'activities', :action => 'index', :id => @project, :from => User.current.time_to_date(time)},options.reverse_merge(:title => format_time(time)))
else else
content_tag('acronym', text, :title => format_time(time)) content_tag('acronym', text, options.reverse_merge(:title => format_time(time)))
end end
end end

@ -30,7 +30,7 @@
</span> </span>
<span class="font_lighter" style="float: right"> <span class="font_lighter" style="float: right">
<%= l(:label_bids_published) %>&nbsp; <%= l(:label_bids_published) %>&nbsp;
<%= time_tag(journal.created_on).html_safe %>&nbsp; <%= time_tag(journal.created_on,:style => "float:initial").html_safe %>&nbsp;
<%= l(:label_bids_published_ago) %> <%= l(:label_bids_published_ago) %>
</span> </span>
</div> </div>

Loading…
Cancel
Save