Sha256: 395b4e4ac6a4d44f007f39063d90347f34d21996646c92ac3685aa7fd01f72ad

Contents?: true

Size: 717 Bytes

Versions: 26

Compression:

Stored size: 717 Bytes

Contents

module Admin
  module ImagesHelper

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

    def current_image_view
      RefinerySetting.find_or_set(:preferred_image_view, :grid)
    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, :renderer => Refinery::LinkRenderer
    end

  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
refinerycms-images-1.0.4 app/helpers/admin/images_helper.rb
refinerycms-images-1.0.3 app/helpers/admin/images_helper.rb
refinerycms-images-1.0.1 app/helpers/admin/images_helper.rb
refinerycms-images-1.0.0 app/helpers/admin/images_helper.rb
refinerycms-images-0.9.9.22 app/helpers/admin/images_helper.rb
refinerycms-images-0.9.9.21 app/helpers/admin/images_helper.rb
refinerycms-images-0.9.9.20 app/helpers/admin/images_helper.rb
refinerycms-images-0.9.9.19 app/helpers/admin/images_helper.rb
refinerycms-images-0.9.9.18 app/helpers/admin/images_helper.rb
refinerycms-images-0.9.9.17 app/helpers/admin/images_helper.rb
refinerycms-images-0.9.9.16 app/helpers/admin/images_helper.rb
refinerycms-images-0.9.9.15 app/helpers/admin/images_helper.rb
refinerycms-images-0.9.9.14 app/helpers/admin/images_helper.rb
refinerycms-images-0.9.9.13 app/helpers/admin/images_helper.rb
refinerycms-images-0.9.9.12 app/helpers/admin/images_helper.rb
refinerycms-images-0.9.9.11 app/helpers/admin/images_helper.rb
refinerycms-images-0.9.9.10 app/helpers/admin/images_helper.rb
refinerycms-images-0.9.9.9 app/helpers/admin/images_helper.rb
refinerycms-images-0.9.9.8 app/helpers/admin/images_helper.rb
refinerycms-images-0.9.9.7 app/helpers/admin/images_helper.rb