diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ad4c4644..ea763548 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 a34b9686..55fe3ac0 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