Commit 587502390b3afa423a10f98f7568a26352cb0976
1 parent
1f5891e9
Exists in
spb-stable
and in
2 other branches
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
Showing
4 changed files
with
5 additions
and
5 deletions
Show diff stats
app/assets/javascripts/project_users_select.js.coffee
@@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
43 | avatar = avatar.replace('%{hash}', md5(user.email)) | 43 | avatar = avatar.replace('%{hash}', md5(user.email)) |
44 | avatar = avatar.replace('%{size}', '24') | 44 | avatar = avatar.replace('%{size}', '24') |
45 | else | 45 | else |
46 | - avatar = gon.relative_url_root + "/assets/no_avatar.png" | 46 | + avatar = gon.relative_url_root + "#{image_path('no_avatar.png')}" |
47 | 47 | ||
48 | if user.id == '' | 48 | if user.id == '' |
49 | avatarMarkup = '' | 49 | avatarMarkup = '' |
app/assets/javascripts/users_select.js.coffee
@@ -7,7 +7,7 @@ $ -> | @@ -7,7 +7,7 @@ $ -> | ||
7 | avatar = avatar.replace('%{hash}', md5(user.email)) | 7 | avatar = avatar.replace('%{hash}', md5(user.email)) |
8 | avatar = avatar.replace('%{size}', '24') | 8 | avatar = avatar.replace('%{size}', '24') |
9 | else | 9 | else |
10 | - avatar = gon.relative_url_root + "/assets/no_avatar.png" | 10 | + avatar = gon.relative_url_root + "#{image_path('no_avatar.png')}" |
11 | 11 | ||
12 | "<div class='user-result'> | 12 | "<div class='user-result'> |
13 | <div class='user-image'><img class='avatar s24' src='#{avatar}'></div> | 13 | <div class='user-image'><img class='avatar s24' src='#{avatar}'></div> |
app/helpers/application_helper.rb
@@ -71,7 +71,7 @@ module ApplicationHelper | @@ -71,7 +71,7 @@ module ApplicationHelper | ||
71 | size = 40 if size.nil? || size <= 0 | 71 | size = 40 if size.nil? || size <= 0 |
72 | 72 | ||
73 | if !Gitlab.config.gravatar.enabled || user_email.blank? | 73 | if !Gitlab.config.gravatar.enabled || user_email.blank? |
74 | - '/assets/no_avatar.png' | 74 | + image_path('no_avatar.png') |
75 | else | 75 | else |
76 | gravatar_url = request.ssl? || gitlab_config.https ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url | 76 | gravatar_url = request.ssl? || gitlab_config.https ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url |
77 | user_email.strip! | 77 | user_email.strip! |
spec/helpers/application_helper_spec.rb
@@ -79,11 +79,11 @@ describe ApplicationHelper do | @@ -79,11 +79,11 @@ describe ApplicationHelper do | ||
79 | 79 | ||
80 | it "should return a generic avatar path when Gravatar is disabled" do | 80 | it "should return a generic avatar path when Gravatar is disabled" do |
81 | Gitlab.config.gravatar.stub(:enabled).and_return(false) | 81 | Gitlab.config.gravatar.stub(:enabled).and_return(false) |
82 | - gravatar_icon(user_email).should == '/assets/no_avatar.png' | 82 | + gravatar_icon(user_email).should match('no_avatar.png') |
83 | end | 83 | end |
84 | 84 | ||
85 | it "should return a generic avatar path when email is blank" do | 85 | it "should return a generic avatar path when email is blank" do |
86 | - gravatar_icon('').should == '/assets/no_avatar.png' | 86 | + gravatar_icon('').should match('no_avatar.png') |
87 | end | 87 | end |
88 | 88 | ||
89 | it "should return default gravatar url" do | 89 | it "should return default gravatar url" do |