用户组织图片不存在时处理
This commit is contained in:
parent
421fba24c2
commit
a18bc247bb
|
@ -10,7 +10,7 @@ json.max_repo_creation organization.max_repo_creation
|
|||
json.num_projects organization.num_projects
|
||||
json.num_users organization.num_users
|
||||
json.num_teams organization.num_teams
|
||||
json.avatar_url url_to_avatar(organization)
|
||||
json.avatar_url url_to_avatar(organization).blank?? User::Avatar.get_letter_avatar_url(organization.login) : url_to_avatar(organization)
|
||||
json.created_at organization.created_on.strftime("%Y-%m-%d")
|
||||
json.news_banner_id organization.news_banner_id
|
||||
json.news_content organization.news_content
|
||||
|
|
|
@ -11,7 +11,7 @@ json.projects do
|
|||
json.name owner.try(:show_real_name)
|
||||
json.type owner.type
|
||||
json.login owner.login
|
||||
json.image_url url_to_avatar(owner)
|
||||
json.image_url url_to_avatar(owner).blank?? User::Avatar.get_letter_avatar_url(owner.login) : url_to_avatar(owner)
|
||||
end
|
||||
|
||||
json.category do
|
||||
|
|
|
@ -30,7 +30,7 @@ json.projects @projects do |project|
|
|||
json.type user.type
|
||||
json.name user.try(:show_real_name)
|
||||
json.login user.login
|
||||
json.image_url url_to_avatar(user)
|
||||
json.image_url url_to_avatar(user).blank?? User::Avatar.get_letter_avatar_url(user.login) : url_to_avatar(user)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue