Merge pull request #7012 from MrMarvin/issue_229_no_avatar_png_path_in_coffee

fixes gitlab.com issue #229 - github.com issue #6976
This commit is contained in:
Dmitriy Zaporozhets 2014-06-11 14:21:59 +03:00
commit bf941ce9ac
4 changed files with 5 additions and 5 deletions

View file

@ -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 = ''

View file

@ -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>

View file

@ -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!

View file

@ -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