Commit bf941ce9 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #7012 from MrMarvin/issue_229_no_avatar_png_path_in_coffee

fixes gitlab.com issue #229 - github.com issue #6976
parents 1f5891e9 58750239
......@@ -43,7 +43,7 @@
avatar = avatar.replace('%{hash}', md5(user.email))
avatar = avatar.replace('%{size}', '24')
else
avatar = gon.relative_url_root + "/assets/no_avatar.png"
avatar = gon.relative_url_root + "#{image_path('no_avatar.png')}"
if user.id == ''
avatarMarkup = ''
......
......@@ -7,7 +7,7 @@ $ ->
avatar = avatar.replace('%{hash}', md5(user.email))
avatar = avatar.replace('%{size}', '24')
else
avatar = gon.relative_url_root + "/assets/no_avatar.png"
avatar = gon.relative_url_root + "#{image_path('no_avatar.png')}"
"<div class='user-result'>
<div class='user-image'><img class='avatar s24' src='#{avatar}'></div>
......
......@@ -71,7 +71,7 @@ module ApplicationHelper
size = 40 if size.nil? || size <= 0
if !Gitlab.config.gravatar.enabled || user_email.blank?
'/assets/no_avatar.png'
image_path('no_avatar.png')
else
gravatar_url = request.ssl? || gitlab_config.https ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url
user_email.strip!
......
......@@ -79,11 +79,11 @@ describe ApplicationHelper do
it "should return a generic avatar path when Gravatar is disabled" do
Gitlab.config.gravatar.stub(:enabled).and_return(false)
gravatar_icon(user_email).should == '/assets/no_avatar.png'
gravatar_icon(user_email).should match('no_avatar.png')
end
it "should return a generic avatar path when email is blank" do
gravatar_icon('').should == '/assets/no_avatar.png'
gravatar_icon('').should match('no_avatar.png')
end
it "should return default gravatar url" do
......
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