link
This commit is contained in:
parent
8ae0fc6c22
commit
e39f82882b
|
@ -1,9 +1,10 @@
|
||||||
module UserHelper
|
module UserHelper
|
||||||
# Decides what user name to show.
|
# Decides what user name to show.
|
||||||
# @return [String] The user name
|
# @return [String] The user name
|
||||||
def user_screen_name(user, anonymous=false)
|
def user_screen_name(user, anonymous=false, url=true)
|
||||||
return APP_CONFIG['anonymous_name'] if user.nil? || anonymous
|
return APP_CONFIG['anonymous_name'] if user.nil? || anonymous
|
||||||
return user.display_name unless user.display_name.blank?
|
name = user.display_name.blank? ? user.screen_name : user.display_name
|
||||||
user.screen_name
|
return link_to(name, show_user_profile_path(current_user.screen_name)) if url
|
||||||
|
name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue