summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-07-16 19:33:15 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-07-16 19:33:15 +0000
commit795220a1e6c9ccc702a79ed8696fe4722448a3c1 (patch)
treedf964686999e2d6b837eb33d8c7f626d97c3c9a3 /app
parentaef25a5e329f0fa5a36ecc0253e0eb39e3b2e2ee (diff)
downloadredmine-795220a1e6c9ccc702a79ed8696fe4722448a3c1.tar.gz
redmine-795220a1e6c9ccc702a79ed8696fe4722448a3c1.zip
Adds links to the user page on various views.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1674 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/helpers/application_helper.rb3
-rw-r--r--app/models/user.rb4
2 files changed, 6 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index ad4c46440..ea7635483 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -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)
diff --git a/app/models/user.rb b/app/models/user.rb
index a34b96861..55fe3ac0d 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -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