Sha256: 7f553cf9c285d2e023d00801dd8007743230be04b01037c2254a4359901ab366

Contents?: true

Size: 768 Bytes

Versions: 11

Compression:

Stored size: 768 Bytes

Contents

module Refinery
  module Admin
    module ImagesHelper
      def other_image_views
        Refinery::Images.image_views.reject { |image_view|
          image_view.to_s == Refinery::Images.preferred_image_view.to_s
        }
      end

      def thumbnail_urls(image)
        thumbnail_urls = {
          :"data-original" => asset_paths.compute_public_path(image.url, ''),
          :"data-grid" => asset_paths.compute_public_path(image.thumbnail('135x135#c').url, '')
        }

        Refinery::Images.user_image_sizes.sort_by{|key,geometry| geometry}.each do |size, pixels|
          thumbnail_urls[:"data-#{size.to_s.parameterize}"] = asset_paths.compute_public_path(image.thumbnail(pixels).url, '')
        end

        thumbnail_urls
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
refinerycms-images-2.0.10 app/helpers/refinery/admin/images_helper.rb
refinerycms-images-2.0.9 app/helpers/refinery/admin/images_helper.rb
refinerycms-images-2.0.8 app/helpers/refinery/admin/images_helper.rb
refinerycms-images-2.0.7 app/helpers/refinery/admin/images_helper.rb
refinerycms-images-2.0.6 app/helpers/refinery/admin/images_helper.rb
refinerycms-images-2.0.5 app/helpers/refinery/admin/images_helper.rb
refinerycms-images-2.0.4 app/helpers/refinery/admin/images_helper.rb
refinerycms-images-2.0.3 app/helpers/refinery/admin/images_helper.rb
refinerycms-images-2.0.2 app/helpers/refinery/admin/images_helper.rb
refinerycms-images-2.0.1 app/helpers/refinery/admin/images_helper.rb
refinerycms-images-2.0.0 app/helpers/refinery/admin/images_helper.rb