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
996f8154
Commit
996f8154
authored
Feb 09, 2018
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract method to improve readability.
parent
217df548
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
app/helpers/avatars_helper.rb
app/helpers/avatars_helper.rb
+11
-7
No files found.
app/helpers/avatars_helper.rb
View file @
996f8154
...
...
@@ -8,17 +8,21 @@ module AvatarsHelper
}))
end
def
user_avatar_url_for
(
options
=
{})
if
options
[
:url
]
options
[
:url
]
elsif
options
[
:user
]
avatar_icon_for_user
(
options
[
:user
],
options
[
:size
])
else
avatar_icon_for_email
(
options
[
:user_email
],
options
[
:size
])
end
end
def
user_avatar_without_link
(
options
=
{})
avatar_size
=
options
[
:size
]
||
16
user_name
=
options
[
:user
].
try
(
:name
)
||
options
[
:user_name
]
avatar_url
=
if
options
[
:url
]
options
[
:url
]
elsif
options
[
:user
]
avatar_icon_for_user
(
options
[
:user
],
avatar_size
)
else
avatar_icon_for_email
(
options
[
:user_email
],
avatar_size
)
end
avatar_url
=
user_avatar_url_for
(
options
.
merge
(
size:
avatar_size
))
has_tooltip
=
options
[
:has_tooltip
].
nil?
?
true
:
options
[
:has_tooltip
]
data_attributes
=
options
[
:data
]
||
{}
...
...
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