mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-21 12:47:48 +01:00
link
This commit is contained in:
parent
8ae0fc6c22
commit
e39f82882b
1 changed files with 4 additions and 3 deletions
|
@ -1,9 +1,10 @@
|
|||
module UserHelper
|
||||
# Decides what user name to show.
|
||||
# @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 user.display_name unless user.display_name.blank?
|
||||
user.screen_name
|
||||
name = user.display_name.blank? ? user.screen_name : user.display_name
|
||||
return link_to(name, show_user_profile_path(current_user.screen_name)) if url
|
||||
name
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue