Commit 1d48904a authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Show avatars in ajax user selectbox

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent abb31213
$ ->
userFormatResult = (user) ->
if user.avatar
avatar = user.avatar.url
if user.avatar_url
avatar = user.avatar_url
else if gon.gravatar_enabled
avatar = gon.gravatar_url
avatar = avatar.replace('%{hash}', md5(user.email))
......
......@@ -78,3 +78,7 @@ select {
.project-refs-form .select2-container {
margin-right: 10px;
}
.ajax-users-dropdown .select2-search {
padding-top: 4px;
}
......@@ -6,6 +6,12 @@ module API
expose :is_admin?, as: :is_admin
expose :can_create_group?, as: :can_create_group
expose :can_create_project?, as: :can_create_project
expose :avatar_url do |user, options|
if user.avatar.present?
user.avatar.url
end
end
end
class UserSafe < Grape::Entity
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment