summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2017-10-05 16:29:45 +0200
committerTim Zallmann <tzallmann@gitlab.com>2017-10-05 16:29:45 +0200
commitd2620faff92f235d5659ccdac0825cf18c7e2389 (patch)
tree14c9004c7c39b5a8fc986aaacdb22e92adc3728f
parent27577e8e2b7bf18c0dbc402e5efad4905c5a154c (diff)
downloadgitlab-ce-d2620faff92f235d5659ccdac0825cf18c7e2389.tar.gz
Updates based on MR comments
-rw-r--r--app/helpers/application_helper.rb15
-rw-r--r--app/helpers/lazy_image_tag_helper.rb12
-rw-r--r--app/models/concerns/avatarable.rb8
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