Sha256: 521caec6c55db29c3f755c05da3959feda133cb6fc6e9b0ab9313d6edf7a1196

Contents?: true

Size: 580 Bytes

Versions: 23

Compression:

Stored size: 580 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # This class deals with uploading avatars to a User.
  class AvatarUploader < ImageUploader
    set_variants do
      {
        profile: { resize_to_fill: [536, 640] },
        big: { resize_to_fit: [80, 80] },
        thumb: { resize_to_fit: [40, 40] }
      }
    end

    def default_url(*)
      ActionController::Base.helpers.asset_pack_path("media/images/default-avatar.svg")
    end

    def default_multiuser_url(*)
      ActionController::Base.helpers.asset_pack_path("media/images/avatar-multiuser.png")
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
decidim-core-0.26.10 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.26.9 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.26.8 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.26.7 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.26.5 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.27.1 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.26.4 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.27.0 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.26.3 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.27.0.rc2 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.27.0.rc1 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.26.2 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.26.1 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.26.0 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.26.0.rc2 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.26.0.rc1 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.25.2 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.25.1 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.25.0 app/uploaders/decidim/avatar_uploader.rb
decidim-core-0.25.0.rc4 app/uploaders/decidim/avatar_uploader.rb