Sha256: 5dbdc735d63a97c894962f4b0280407cd4d08276bb6513ccc003cee4784eaacc

Contents?: true

Size: 1.48 KB

Versions: 6

Compression:

Stored size: 1.48 KB

Contents

ActiveAdmin.register Ecm::CmsCore::Template do
  menu :label => Ecm::CmsCore::Template.model_name.human(:count => 10)
  
  scope :all
  scope :templates
  scope :partials
  
  
  form do |f|
    f.inputs do
      f.input :folder, :as => :select, :collection => nested_set_options(Ecm::CmsCore::Folder) { |i| "#{'    ' * i.level} |--#{i.basename}".html_safe }
      f.input :basename
      f.input :title
      f.input :meta_description
      f.input :body
      f.input :layout
      f.input :locale,  :as => :select, :collection => I18n.available_locales.map(&:to_s)  
      f.input :format,  :as => :select, :collection => Mime::SET.symbols.map(&:to_s)
      f.input :handler, :as => :select, :collection => ActionView::Template::Handlers.extensions.map(&:to_s)
      f.input :partial
    end
    f.buttons
  end
  
  index :title => Ecm::CmsCore::Template.model_name.human(:count => 10) do
    column :folder, :sortable => :pathname
    column :filename, :sortable => :basename
    column :formatted_partial_flag, :sortable => :partial
    column :created_at
    column :updated_at
    
    default_actions
  end
  
  show :title => :to_s do
    attributes_table do
      row :folder
      row :filename
      row :title
      row :meta_description
      row :formatted_partial_flag
      row :created_at
      row :updated_at
    end
    
    panel Ecm::CmsCore::Template.human_attribute_name(:body) do
      div do
        t(ecm_cms_core_template.body).html_safe
      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/templates.rb
ecm_cms_core-0.0.7 lib/generators/ecm/cms_core/active_admin/templates/templates.rb
ecm_cms_core-0.0.6 lib/generators/ecm/cms_core/active_admin/templates/templates.rb
ecm_cms_core-0.0.5 lib/generators/ecm/cms_core/active_admin/templates/templates.rb
ecm_cms_core-0.0.3 lib/generators/ecm/cms_core/active_admin/templates/templates.rb
ecm_cms_core-0.0.2 lib/generators/ecm/cms_core/active_admin/templates/templates.rb