Commit c18e2778b2f1a4a2c3fb8e0f79c400456645e036

Authored by Olaf Mandel
1 parent 761fbbfe

Fix avatar URLs in JS-lists for relative_url_root

In user lists created when entering a (partial) user name into
a field, the URL to the user avatar was invalid if running with
relative_url_root.

This patch is the result of:
sed -i 's/\(= *\)\(user\.avatar_url\)/\1gon.relative_url_root + \2/' \
    app/assets/javascripts/*.coffee
app/assets/javascripts/project_users_select.js.coffee
... ... @@ -37,7 +37,7 @@
37 37  
38 38 projectUserFormatResult: (user) ->
39 39 if user.avatar_url
40   - avatar = user.avatar_url
  40 + avatar = gon.relative_url_root + user.avatar_url
41 41 else if gon.gravatar_enabled
42 42 avatar = gon.gravatar_url
43 43 avatar = avatar.replace('%{hash}', md5(user.email))
... ...
app/assets/javascripts/users_select.js.coffee
1 1 $ ->
2 2 userFormatResult = (user) ->
3 3 if user.avatar_url
4   - avatar = user.avatar_url
  4 + avatar = gon.relative_url_root + user.avatar_url
5 5 else if gon.gravatar_enabled
6 6 avatar = gon.gravatar_url
7 7 avatar = avatar.replace('%{hash}', md5(user.email))
... ...