Commit 58750239 authored by Marvin Frick's avatar Marvin Frick

fixes gitlab.com issue #229

Changes .js.coffe files to not use a hardcoded path to
`no_avatar.png` but instead stick with the asset pipeline.

renames coffee.erb back to coffee
parent 1f5891e9
......@@ -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