Sha256: 92fa6784655b3f950fdffc672782aab8c0fbcd07d5dd807b303654aac580c2b7

Contents?: true

Size: 739 Bytes

Versions: 20

Compression:

Stored size: 739 Bytes

Contents

module Locomotive
  module Concerns
    module Asset
      module Vignette

        def vignette_url
          if self.image?
            if self.width < 85 && self.height < 85
              self.source.url
            else
              Locomotive::Dragonfly.resize_url(self.source, '85x85#')
            end
          elsif self.pdf?
            Locomotive::Dragonfly.thumbnail_pdf(self.source, '85x85#')
          end
        end

        def alternative_vignette_url
          format = if self.image? && self.width && self.height
            '190x120>'
          elsif self.pdf?
            '190x120#'
          end

          Locomotive::Dragonfly.thumbnail_pdf(self.source, format) if format
        end

      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
locomotivecms-3.4.1 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.4.0 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.3.0 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.3.0.rc3 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.3.0.rc2 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.1.2 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.2.1 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.3.0.rc1 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.2.0 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.2.0.rc2 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.2.0.rc1 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.1.1 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.1.0 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.1.0.rc3 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.1.0.rc2 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.1.0.rc1 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.0.1 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.0.0 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.0.0.rc7 app/models/locomotive/concerns/asset/vignette.rb
locomotivecms-3.0.0.rc6 app/models/locomotive/concerns/asset/vignette.rb