FEATURE: display github profile links on user card and profile

Can be disabled by unchecking "public_github_screen_name"
This commit is contained in:
Sam
2014-11-04 13:33:58 +11:00
parent e14e2b8158
commit 95c518329a
8 changed files with 30 additions and 2 deletions

View File

@ -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)