diaspora/app/presenters/avatar_presenter.rb
Dennis Schubert dbbf743920
Add the scaled_full image as a raw image in AvatarPresenter as well.
This is a temporary workaround. Adding the real raw photo is quite a
challange and touches multiple components nobody wants to touch right
now. As this change is blocking an actual hotfix, this is fine, and will
be properly fixed at a later time.
2020-02-04 15:52:57 +01:00

32 lines
815 B
Ruby

# frozen_string_literal: true
class AvatarPresenter < BasePresenter
def base_hash(with_default=false)
avatar = {
small: small(with_default),
medium: medium(with_default),
large: large(with_default),
raw: raw(with_default) # rubocop:disable Rails/OutputSafety
}.compact
avatar unless avatar.empty?
end
def small(with_default=false)
image_url(size: :thumb_small, fallback_to_default: with_default)
end
def medium(with_default=false)
image_url(size: :thumb_medium, fallback_to_default: with_default)
end
def large(with_default=false)
image_url(size: :scaled_full, fallback_to_default: with_default)
end
def raw(with_default=false)
# TODO: Replace me with the actual raw photo.
image_url(fallback_to_default: with_default)
end
end