Sha256: 4f52586f14b7b9fc13ab135c778ae64e43489fd75b3a8cf6504295a9a22badb1

Contents?: true

Size: 878 Bytes

Versions: 12

Compression:

Stored size: 878 Bytes

Contents

module Spotlight
  ##
  # Page, browse category, and exhibit featured image thumbnails
  class FeaturedImageUploader < CarrierWave::Uploader::Base
    include CarrierWave::MiniMagick

    storage Spotlight::Engine.config.uploader_storage

    version :cropped do
      process crop: :image ## Crops this version based on original image
    end

    version :thumb, from_version: :cropped do
      process resize_to_fill: Spotlight::Engine.config.featured_image_thumb_size
    end

    version :square, from_version: :cropped do
      process resize_to_fill: Spotlight::Engine.config.featured_image_square_size
    end

    def store_dir
      "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
    end

    def default_url
      ActionController::Base.helpers.image_path('spotlight/fallback/' + [version_name, 'default.png'].compact.join('_'))
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
blacklight-spotlight-0.32.0 app/uploaders/spotlight/featured_image_uploader.rb
blacklight-spotlight-0.31.0 app/uploaders/spotlight/featured_image_uploader.rb
blacklight-spotlight-0.30.0 app/uploaders/spotlight/featured_image_uploader.rb
blacklight-spotlight-0.29.1 app/uploaders/spotlight/featured_image_uploader.rb
blacklight-spotlight-0.29.0 app/uploaders/spotlight/featured_image_uploader.rb
blacklight-spotlight-0.28.3 app/uploaders/spotlight/featured_image_uploader.rb
blacklight-spotlight-0.28.2 app/uploaders/spotlight/featured_image_uploader.rb
blacklight-spotlight-0.28.1 app/uploaders/spotlight/featured_image_uploader.rb
blacklight-spotlight-0.28.0 app/uploaders/spotlight/featured_image_uploader.rb
blacklight-spotlight-0.27.0 app/uploaders/spotlight/featured_image_uploader.rb
blacklight-spotlight-0.26.1 app/uploaders/spotlight/featured_image_uploader.rb
blacklight-spotlight-0.26.0 app/uploaders/spotlight/featured_image_uploader.rb