Commit ebe1411c authored by Andreas Brandl's avatar Andreas Brandl

Extract method to improve readability.

parent 0c3d6de1
Pipeline #17341984 failed with stages
in 45 minutes and 43 seconds
......@@ -8,17 +8,21 @@ module AvatarsHelper
}))
end
def avatar_url_for(options = {})
if options[:url]
options[:url]
elsif options[:user]
avatar_icon_for_user(options[:user], avatar_size)
else
avatar_icon_for_email(options[:user_email], avatar_size)
end
end
def user_avatar_without_link(options = {})
avatar_size = options[:size] || 16
user_name = options[:user].try(:name) || options[:user_name]
avatar_url = if options[:url]
options[:url]
elsif options[:user]
avatar_icon_for_user(options[:user], avatar_size)
else
avatar_icon_for_email(options[:user_email], avatar_size)
end
avatar_url = avatar_url_for(options)
has_tooltip = options[:has_tooltip].nil? ? true : options[:has_tooltip]
data_attributes = options[:data] || {}
......
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