Sha256: ca9b0a21bdb1f637920dead6ed640ccb31daf6dd70c1f7e12efb112d3f5f0153

Contents?: true

Size: 996 Bytes

Versions: 7

Compression:

Stored size: 996 Bytes

Contents

module Enjoy
  module Admin
    module Gallery
      def self.config(fields = {})
        Proc.new {
          # navigation_label I18n.t('enjoy.gallery')
          field :enabled, :toggle

          field :name, :string
          field :slugs, :enum do
            enum_method do
              :slugs
            end
            visible do
              bindings[:view].current_user.admin?
            end
            multiple do
              true
            end
          end
          field :text_slug

          field :image, :jcrop do
            jcrop_options :image_jcrop_options
          end

          fields.each_pair do |name, type|
            if type.nil?
              field name
            else
              if type.is_a?(Array)
                field name, type[0], &type[1]
              else
                field name, type
              end
            end
          end

          if block_given?
            yield self
          end
        }
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
enjoy_cms-0.3.1.2 lib/enjoy/admin/gallery.rb
enjoy_cms-0.3.1.1 lib/enjoy/admin/gallery.rb
enjoy_cms-0.3.1 lib/enjoy/admin/gallery.rb
enjoy_cms-0.3.0.4 lib/enjoy/admin/gallery.rb
enjoy_cms-0.3.0.3 lib/enjoy/admin/gallery.rb
enjoy_cms-0.3.0.2 lib/enjoy/admin/gallery.rb
enjoy_cms-0.2.1 lib/enjoy/admin/gallery.rb