Sha256: 6eaa180cb0dba4738d882c1dca5d2cdc94573f5ac535476fb84884050c76bc5b

Contents?: true

Size: 670 Bytes

Versions: 11

Compression:

Stored size: 670 Bytes

Contents

module Pageflow
  # @api private
  class ImageFileCssBackgroundImageUrls
    def call(image_file, entry:)
      {
        default: {
          desktop: image_file.ready? ? image_file.attachment.url(desktop_style(entry)) : '',
          mobile: image_file.ready? ? image_file.attachment.url(:medium) : ''
        },
        panorama: {
          desktop: image_file.ready? ? image_file.attachment.url(:panorama_large) : '',
          mobile: image_file.ready? ? image_file.attachment.url(:panorama_medium) : ''
        }
      }
    end

    private

    def desktop_style(entry)
      entry.feature_state('highdef_background_images') ? :ultra : :large
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
pageflow-17.0.4 app/models/pageflow/image_file_css_background_image_urls.rb
pageflow-17.0.3 app/models/pageflow/image_file_css_background_image_urls.rb
pageflow-17.0.2 app/models/pageflow/image_file_css_background_image_urls.rb
pageflow-17.0.1 app/models/pageflow/image_file_css_background_image_urls.rb
pageflow-17.0.0 app/models/pageflow/image_file_css_background_image_urls.rb
pageflow-16.2.0 app/models/pageflow/image_file_css_background_image_urls.rb
pageflow-16.1.0 app/models/pageflow/image_file_css_background_image_urls.rb
pageflow-16.0.0 app/models/pageflow/image_file_css_background_image_urls.rb
pageflow-15.8.0 app/models/pageflow/image_file_css_background_image_urls.rb
pageflow-15.7.1 app/models/pageflow/image_file_css_background_image_urls.rb
pageflow-15.7.0 app/models/pageflow/image_file_css_background_image_urls.rb