Commit d2620faf authored by Tim Zallmann's avatar Tim Zallmann

Updates based on MR comments

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