summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-10-10 12:48:19 +0000
committerDouwe Maan <douwe@gitlab.com>2017-10-10 12:48:19 +0000
commit36ae3bf1ca476515ba66f6e3e505cbb035534764 (patch)
treecb7f5dfafb8ac52e512237232a5a64c9ffd888cf /app/helpers
parentb71208531a492fa5e5266dba32e0a4949b29f51f (diff)
parent75c6953fc76422b138335680b227e7303d20c136 (diff)
downloadgitlab-ce-36ae3bf1ca476515ba66f6e3e505cbb035534764.tar.gz
Merge branch '38245-private-avatars-are-not-cdn-compatible' into 'master'
Resolve "Private Avatars are not CDN compatible" Closes #38245 and gitlab-com/support-forum#2476 See merge request gitlab-org/gitlab-ce!14443
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/groups_helper.rb9
-rw-r--r--app/helpers/lazy_image_tag_helper.rb1
2 files changed, 8 insertions, 2 deletions
diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb
index 82bceddf1f0..676c1d1988b 100644
--- a/app/helpers/groups_helper.rb
+++ b/app/helpers/groups_helper.rb
@@ -7,7 +7,12 @@ module GroupsHelper
can?(current_user, :change_share_with_group_lock, group)
end
- def group_icon(group)
+ def group_icon(group, options = {})
+ img_path = group_icon_url(group, options)
+ image_tag img_path, options
+ end
+
+ def group_icon_url(group, options = {})
if group.is_a?(String)
group = Group.find_by_full_path(group)
end
@@ -89,7 +94,7 @@ module GroupsHelper
link_to(group_path(group), class: "group-path #{'breadcrumb-item-text' unless for_dropdown} js-breadcrumb-item-text #{'hidable' if hidable}") do
output =
if (group.try(:avatar_url) || show_avatar) && !Rails.env.test?
- image_tag(group_icon(group), class: "avatar-tile", width: 15, height: 15)
+ group_icon(group, class: "avatar-tile", width: 15, height: 15)
else
""
end
diff --git a/app/helpers/lazy_image_tag_helper.rb b/app/helpers/lazy_image_tag_helper.rb
index 2c5619ac41b..603b9438e35 100644
--- a/app/helpers/lazy_image_tag_helper.rb
+++ b/app/helpers/lazy_image_tag_helper.rb
@@ -10,6 +10,7 @@ module LazyImageTagHelper
unless options.delete(:lazy) == false
options[:data] ||= {}
options[:data][:src] = path_to_image(source)
+
options[:class] ||= ""
options[:class] << " lazy"