Sha256: 4366acce7a22fb478e5269c07ff9515cd5c9fb823f53295ecdde63477a41a457

Contents?: true

Size: 799 Bytes

Versions: 9

Compression:

Stored size: 799 Bytes

Contents

module Admin::ImagesHelper

  def image_views
    RefinerySetting.find_or_set(:image_views, [:grid, :list])
  end

  def current_image_view
    RefinerySetting.find_or_set(:preferred_image_view, :list)
  end

  def other_image_views
    image_views.reject {|image_view| image_view.to_s == current_image_view.to_s }
  end

  def change_list_mode_if_specified
    if action_name == 'index' and params[:view].present? and image_views.include?(params[:view].to_sym)
      RefinerySetting.set(:preferred_image_view, params[:view])
    end
  end

  def images_paginator(collection, dialog = false)
    will_paginate collection, :previous_label => '« Previous',
                              :next_label => 'Next »',
                              :renderer => Refinery::LinkRenderer
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
refinerycms-0.9.8.9 vendor/refinerycms/images/app/helpers/admin/images_helper.rb
refinerycms-0.9.8.8 vendor/refinerycms/images/app/helpers/admin/images_helper.rb
refinerycms-0.9.8.7 vendor/refinerycms/images/app/helpers/admin/images_helper.rb
refinerycms-0.9.8.6 vendor/refinerycms/images/app/helpers/admin/images_helper.rb
refinerycms-0.9.8.5 vendor/refinerycms/images/app/helpers/admin/images_helper.rb
refinerycms-0.9.8.4 vendor/refinerycms/images/app/helpers/admin/images_helper.rb
refinerycms-0.9.8.3 vendor/refinerycms/images/app/helpers/admin/images_helper.rb
refinerycms-0.9.8.2 vendor/refinerycms/images/app/helpers/admin/images_helper.rb
refinerycms-0.9.8.1 vendor/refinerycms/images/app/helpers/admin/images_helper.rb