diff options
Diffstat (limited to 'app/helpers/avatars_helper.rb')
-rw-r--r-- | app/helpers/avatars_helper.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/helpers/avatars_helper.rb b/app/helpers/avatars_helper.rb index 09f91f350bd..4cfa1528d9b 100644 --- a/app/helpers/avatars_helper.rb +++ b/app/helpers/avatars_helper.rb @@ -98,6 +98,14 @@ module AvatarsHelper end end + def avatar_without_link(resource, options = {}) + if resource.is_a?(User) + user_avatar_without_link(options.merge(user: resource)) + elsif resource.is_a?(Group) + group_icon(resource, options.merge(class: 'avatar')) + end + end + private def avatar_icon_by_user_email_or_gravatar(email, size, scale, only_path:) @@ -136,11 +144,12 @@ module AvatarsHelper def source_identicon(source, options = {}) bg_key = (source.id % 7) + 1 + size_class = "s#{options[:size]}" if options[:size] options[:class] = - [*options[:class], "identicon bg#{bg_key}"].join(' ') + [*options[:class], "identicon bg#{bg_key}", size_class].compact.join(' ') - content_tag(:div, class: options[:class].strip) do + content_tag(:span, class: options[:class].strip) do source.name[0, 1].upcase end end |