Commit 8d620e39 authored by Jan-Gerd Tenberge's avatar Jan-Gerd Tenberge

Add scale argument in user class

parent f93177c6
...@@ -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
......
...@@ -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
......
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