Adds links to the user page on various views.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1674 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
aef25a5e32
commit
795220a1e6
|
@ -92,7 +92,8 @@ module ApplicationHelper
|
||||||
|
|
||||||
def authoring(created, author)
|
def authoring(created, author)
|
||||||
time_tag = content_tag('acronym', distance_of_time_in_words(Time.now, created), :title => format_time(created))
|
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
|
end
|
||||||
|
|
||||||
def l_or_humanize(s)
|
def l_or_humanize(s)
|
||||||
|
|
|
@ -201,6 +201,10 @@ class User < ActiveRecord::Base
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def anonymous?
|
||||||
|
!logged?
|
||||||
|
end
|
||||||
|
|
||||||
# Return user's role for project
|
# Return user's role for project
|
||||||
def role_for_project(project)
|
def role_for_project(project)
|
||||||
# No role on archived projects
|
# No role on archived projects
|
||||||
|
|
Loading…
Reference in New Issue