mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 00:27:58 +08:00
FEATURE: display github profile links on user card and profile
Can be disabled by unchecking "public_github_screen_name"
This commit is contained in:
@ -48,7 +48,8 @@ class UserSerializer < BasicUserSerializer
|
||||
:has_title_badges,
|
||||
:edit_history_public,
|
||||
:custom_fields,
|
||||
:user_fields
|
||||
:user_fields,
|
||||
:github_screen_name
|
||||
|
||||
has_one :invited_by, embed: :object, serializer: BasicUserSerializer
|
||||
has_many :custom_groups, embed: :object, serializer: BasicGroupSerializer
|
||||
@ -88,6 +89,11 @@ class UserSerializer < BasicUserSerializer
|
||||
###
|
||||
### ATTRIBUTES
|
||||
###
|
||||
def github_screen_name
|
||||
if SiteSetting.public_github_screen_name
|
||||
object.github_user_info && object.github_user_info.screen_name
|
||||
end
|
||||
end
|
||||
|
||||
def include_email?
|
||||
object.id && object.id == scope.user.try(:id)
|
||||
|
Reference in New Issue
Block a user