Sha256: 808c775d4d3609a1283c36336215d2e21653a95191802b1056b9165dce857fb5

Contents?: true

Size: 1.4 KB

Versions: 6

Compression:

Stored size: 1.4 KB

Contents

include CollectiveIdea::Acts::NestedSet::Helper

ActiveAdmin.register Ecm::CmsCore::Folder do
  scope :all
  scope :root_folders

  menu :label => Ecm::CmsCore::Folder.model_name.human(:count => 10)

  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_template_path(template), :class => "member_link view_link"
        end        
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ecm_cms_core-0.0.8 lib/generators/ecm/cms_core/active_admin/templates/folders.rb
ecm_cms_core-0.0.7 lib/generators/ecm/cms_core/active_admin/templates/folders.rb
ecm_cms_core-0.0.6 lib/generators/ecm/cms_core/active_admin/templates/folders.rb
ecm_cms_core-0.0.5 lib/generators/ecm/cms_core/active_admin/templates/folders.rb
ecm_cms_core-0.0.3 lib/generators/ecm/cms_core/active_admin/templates/folders.rb
ecm_cms_core-0.0.2 lib/generators/ecm/cms_core/active_admin/templates/folders.rb