From 5afa190a9ab93f7a7b40da4e1fd6be7633dab9ce Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 4 Jul 2009 12:36:26 +0000 Subject: [PATCH] Adds issue last update timestamp (#3565). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2803 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 15 ++++++++++----- app/views/issues/show.rhtml | 4 +++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2382983ff..fd070de3a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -201,12 +201,17 @@ module ApplicationHelper end def authoring(created, author, options={}) - time_tag = @project.nil? ? content_tag('acronym', distance_of_time_in_words(Time.now, created), :title => format_time(created)) : - link_to(distance_of_time_in_words(Time.now, created), - {:controller => 'projects', :action => 'activity', :id => @project, :from => created.to_date}, - :title => format_time(created)) author_tag = (author.is_a?(User) && !author.anonymous?) ? link_to(h(author), :controller => 'account', :action => 'show', :id => author) : h(author || 'Anonymous') - l(options[:label] || :label_added_time_by, :author => author_tag, :age => time_tag) + l(options[:label] || :label_added_time_by, :author => author_tag, :age => time_tag(created)) + end + + def time_tag(time) + text = distance_of_time_in_words(Time.now, time) + if @project + link_to(text, {:controller => 'projects', :action => 'activity', :id => @project, :from => time.to_date}, :title => format_time(time)) + else + content_tag('acronym', text, :title => format_time(time)) + end end def syntax_highlight(name, content) diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml index c23acdf83..49796bbf4 100644 --- a/app/views/issues/show.rhtml +++ b/app/views/issues/show.rhtml @@ -14,7 +14,9 @@

<%=h @issue.subject %>

<%= authoring @issue.created_on, @issue.author %>. - <%= l(:label_updated_time, distance_of_time_in_words(Time.now, @issue.updated_on)) + '.' if @issue.created_on != @issue.updated_on %> + <% if @issue.created_on != @issue.updated_on %> + <%= l(:label_updated_time, time_tag(@issue.updated_on)) %>. + <% end %>

-- 2.39.5