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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
8d620e39
Commit
8d620e39
authored
Sep 26, 2015
by
Jan-Gerd Tenberge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add scale argument in user class
parent
f93177c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+2
-2
app/models/user.rb
app/models/user.rb
+2
-2
No files found.
app/helpers/application_helper.rb
View file @
8d620e39
...
@@ -68,13 +68,13 @@ module ApplicationHelper
...
@@ -68,13 +68,13 @@ module ApplicationHelper
end
end
end
end
def
avatar_icon
(
user_email
=
''
,
size
=
nil
)
def
avatar_icon
(
user_email
=
''
,
size
=
nil
,
scale
=
2
)
user
=
User
.
find_by
(
email:
user_email
)
user
=
User
.
find_by
(
email:
user_email
)
if
user
if
user
user
.
avatar_url
(
size
)
||
default_avatar
user
.
avatar_url
(
size
)
||
default_avatar
else
else
gravatar_icon
(
user_email
,
size
)
gravatar_icon
(
user_email
,
size
,
scale
)
end
end
end
end
...
...
app/models/user.rb
View file @
8d620e39
...
@@ -633,11 +633,11 @@ class User < ActiveRecord::Base
...
@@ -633,11 +633,11 @@ class User < ActiveRecord::Base
email
.
start_with?
(
'temp-email-for-oauth'
)
email
.
start_with?
(
'temp-email-for-oauth'
)
end
end
def
avatar_url
(
size
=
nil
)
def
avatar_url
(
size
=
nil
,
scale
=
2
)
if
avatar
.
present?
if
avatar
.
present?
[
gitlab_config
.
url
,
avatar
.
url
].
join
[
gitlab_config
.
url
,
avatar
.
url
].
join
else
else
GravatarService
.
new
.
execute
(
email
,
size
)
GravatarService
.
new
.
execute
(
email
,
size
,
scale
)
end
end
end
end
...
...
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