Module: Refinery::Admin::ImagesHelper

Defined in:
images/app/helpers/refinery/admin/images_helper.rb

Instance Method Summary collapse

Instance Method Details

#other_image_viewsObject



4
5
6
7
8
# File 'images/app/helpers/refinery/admin/images_helper.rb', line 4

def other_image_views
  Refinery::Images.image_views.reject do |image_view|
    image_view.to_s == Refinery::Images.preferred_image_view.to_s
  end
end

#thumbnail_urls(image) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'images/app/helpers/refinery/admin/images_helper.rb', line 10

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

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

  thumbnail_urls
end