Module: Enjoy::Gallery::Admin::Image

Defined in:
lib/enjoy/gallery/admin/image.rb

Class Method Summary collapse

Class Method Details

.config(nav_label = nil, without_gallery = false, fields = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/enjoy/gallery/admin/image.rb', line 4

def self.config(nav_label = nil, without_gallery = false, fields = {})
  Proc.new {
    navigation_label(nav_label || I18n.t('enjoy.gallery'))
    field :enabled, :toggle do
      searchable false
    end
    unless without_gallery
      field :gallery do
        searchable :name
      end
    end
    field :name, :string do
      searchable true
    end
    field :image, :enjoy_image

    nested_set({max_depth: 1, scopes: []})

    Enjoy::RailsAdminGroupPatch::enjoy_cms_group(self, fields)

    if block_given?
      yield self
    end
  }
end