]> source.dussan.org Git - redmine.git/commitdiff
Adds links to the user page on various views.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 16 Jul 2008 19:33:15 +0000 (19:33 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 16 Jul 2008 19:33:15 +0000 (19:33 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1674 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb
app/models/user.rb

index ad4c46440408ff00b6fde76893eed656f71382cb..ea7635483fe80c9c6c7a44c557829204d5b87857 100644 (file)
@@ -92,7 +92,8 @@ module ApplicationHelper
   
   def authoring(created, author)
     time_tag = content_tag('acronym', distance_of_time_in_words(Time.now, created), :title => format_time(created))
-    l(:label_added_time_by, author || 'Anonymous', time_tag)
+    author_tag = (author.is_a?(User) && !author.anonymous?) ? link_to(h(author), :controller => 'account', :action => 'show', :id => author) : h(author || 'Anonymous')
+    l(:label_added_time_by, author_tag, time_tag)
   end
   
   def l_or_humanize(s)
index a34b968617e560902073ae6ffbdbc0a4608c0183..55fe3ac0d446046de4af2ddbc34c4254a447bd99 100644 (file)
@@ -201,6 +201,10 @@ class User < ActiveRecord::Base
     true
   end
   
+  def anonymous?
+    !logged?
+  end
+  
   # Return user's role for project
   def role_for_project(project)
     # No role on archived projects