Commit d2620faf authored by Tim Zallmann's avatar Tim Zallmann

Updates based on MR comments

parent 27577e8e
...@@ -41,12 +41,15 @@ module ApplicationHelper ...@@ -41,12 +41,15 @@ module ApplicationHelper
end end
if project.avatar_url if project.avatar_url
if project.private? #if project.private?
options[:use_original_source] = true # options[:use_original_source] = true
image_tag project.avatar_url(use_asset_path: false), options # image_tag project.avatar_url(use_asset_path: false), options
else #else
image_tag project.avatar_url, options # image_tag project.avatar_url, options
end #end
image_tag project.avatar_url(use_asset_path: project.public?), options
else # generated icon else # generated icon
project_identicon(project, options) project_identicon(project, options)
end end
......
...@@ -9,11 +9,13 @@ module LazyImageTagHelper ...@@ -9,11 +9,13 @@ module LazyImageTagHelper
unless options.delete(:lazy) == false unless options.delete(:lazy) == false
options[:data] ||= {} options[:data] ||= {}
options[:data][:src] = if options.delete(:use_original_source) #options[:data][:src] = if options.delete(:use_original_source)
source # source
else # else
path_to_image(source) # path_to_image(source)
end # end
options[:data][:src] = path_to_image(source)
options[:class] ||= "" options[:class] ||= ""
options[:class] << " lazy" options[:class] << " lazy"
......
...@@ -9,11 +9,9 @@ module Avatarable ...@@ -9,11 +9,9 @@ module Avatarable
asset_host = ActionController::Base.asset_host asset_host = ActionController::Base.asset_host
gitlab_host = only_path ? gitlab_config.relative_url_root : gitlab_config.url gitlab_host = only_path ? gitlab_config.relative_url_root : gitlab_config.url
if use_asset_path
# If asset_host is set then it is expected that assets are handled by a standalone host. # If asset_host is set then it is expected that assets are handled by a standalone host.
# That means we do not want to get GitLab's relative_url_root option anymore. # That means we do not want to get GitLab's relative_url_root option anymore.
host = asset_host.present? ? asset_host : gitlab_host host = (asset_host.present? && use_asset_path) ? asset_host : gitlab_host
end
[host, avatar.url].join [host, avatar.url].join
end end
......
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