Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1d48904a
Commit
1d48904a
authored
Feb 13, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show avatars in ajax user selectbox
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
abb31213
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
app/assets/javascripts/users_select.js.coffee
app/assets/javascripts/users_select.js.coffee
+2
-2
app/assets/stylesheets/generic/selects.scss
app/assets/stylesheets/generic/selects.scss
+4
-0
lib/api/entities.rb
lib/api/entities.rb
+6
-0
No files found.
app/assets/javascripts/users_select.js.coffee
View file @
1d48904a
$
->
$
->
userFormatResult
=
(
user
)
->
userFormatResult
=
(
user
)
->
if
user
.
avatar
if
user
.
avatar
_url
avatar
=
user
.
avatar
.
url
avatar
=
user
.
avatar
_
url
else
if
gon
.
gravatar_enabled
else
if
gon
.
gravatar_enabled
avatar
=
gon
.
gravatar_url
avatar
=
gon
.
gravatar_url
avatar
=
avatar
.
replace
(
'%{hash}'
,
md5
(
user
.
email
))
avatar
=
avatar
.
replace
(
'%{hash}'
,
md5
(
user
.
email
))
...
...
app/assets/stylesheets/generic/selects.scss
View file @
1d48904a
...
@@ -78,3 +78,7 @@ select {
...
@@ -78,3 +78,7 @@ select {
.project-refs-form
.select2-container
{
.project-refs-form
.select2-container
{
margin-right
:
10px
;
margin-right
:
10px
;
}
}
.ajax-users-dropdown
.select2-search
{
padding-top
:
4px
;
}
lib/api/entities.rb
View file @
1d48904a
...
@@ -6,6 +6,12 @@ module API
...
@@ -6,6 +6,12 @@ module API
expose
:is_admin?
,
as: :is_admin
expose
:is_admin?
,
as: :is_admin
expose
:can_create_group?
,
as: :can_create_group
expose
:can_create_group?
,
as: :can_create_group
expose
:can_create_project?
,
as: :can_create_project
expose
:can_create_project?
,
as: :can_create_project
expose
:avatar_url
do
|
user
,
options
|
if
user
.
avatar
.
present?
user
.
avatar
.
url
end
end
end
end
class
UserSafe
<
Grape
::
Entity
class
UserSafe
<
Grape
::
Entity
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment