diff options
-rw-r--r-- | app/helpers/application_helper.rb | 15 | ||||
-rw-r--r-- | app/helpers/lazy_image_tag_helper.rb | 12 | ||||
-rw-r--r-- | app/models/concerns/avatarable.rb | 8 |
3 files changed, 19 insertions, 16 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cfdb95e2498..264f21a1466 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 diff --git a/app/helpers/lazy_image_tag_helper.rb b/app/helpers/lazy_image_tag_helper.rb index 2b5e9a9ef57..c150c2927a9 100644 --- a/app/helpers/lazy_image_tag_helper.rb +++ b/app/helpers/lazy_image_tag_helper.rb @@ -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" diff --git a/app/models/concerns/avatarable.rb b/app/models/concerns/avatarable.rb index 6ed57dea858..dee7e47e2aa 100644 --- a/app/models/concerns/avatarable.rb +++ b/app/models/concerns/avatarable.rb @@ -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 + # 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? && use_asset_path) ? asset_host : gitlab_host [host, avatar.url].join end |