Sha256: 1db554d58b0e85ed39059139f46f31c3d2097131fa95251e0d6a12347e2b6ad9

Contents?: true

Size: 1.58 KB

Versions: 6

Compression:

Stored size: 1.58 KB

Contents

include CollectiveIdea::Acts::NestedSet::Helper

if defined?(ActiveAdmin)
  ActiveAdmin.register Ecm::CmsCore::Folder do
    menu :label =>  Ecm::CmsCore::Folder.model_name.human(:count => 10), :parent => I18n.t('ecm.cms_core.active_admin.menu')
    
    scope :all
    scope :root_folders

    form do |f|
      f.inputs do
        f.input :parent, :as => :select, :collection => nested_set_options(Ecm::CmsCore::Folder, f.object) { |i| "#{'    ' * i.level} |--#{i.basename}".html_safe }
        f.input :basename
      end
      f.buttons
    end
    
    index :title => Ecm::CmsCore::Folder.model_name.human(:count => 10) do
      column :tree_label, :sortable => false
      column :templates_count
      column :created_at
      column :updated_at

      default_actions
    end
    
    show :title => :to_s do |folder|
      attributes_table do
        row :parent
        row :basename
      end
      
      panel Ecm::CmsCore::Template.model_name.human(:count => 10) do
        table_for folder.templates do
          column Ecm::CmsCore::Template.human_attribute_name(:filename), :filename
          column Ecm::CmsCore::Template.human_attribute_name(:partial), :formatted_partial_flag
          column Ecm::CmsCore::Template.human_attribute_name(:created_at), :created_at
          column Ecm::CmsCore::Template.human_attribute_name(:updated_at), :updated_at
          column do |template|
            link_to I18n.t('active_admin.view'), admin_ecm_cms_core_template_path(template), :class => "member_link view_link"
          end        
        end
      end
    end
  end
end  

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ecm_cms_core-0.0.8 app/admin/ecm_cms_core_folders.rb
ecm_cms_core-0.0.7 app/admin/ecm_cms_core_folders.rb
ecm_cms_core-0.0.6 app/admin/ecm_cms_core_folders.rb
ecm_cms_core-0.0.5 app/admin/ecm_cms_core_folders.rb
ecm_cms_core-0.0.3 app/admin/ecm/ecm_core/folders.rb
ecm_cms_core-0.0.2 app/admin/ecm/ecm_core/folders.rb