Sha256: a0e7f108967c12ceebd8579a3ad3ff9a7f552eaac63c34d288edefde5a6b73fa

Contents?: true

Size: 847 Bytes

Versions: 3

Compression:

Stored size: 847 Bytes

Contents

class Admin::StructuresController < Admin::BaseController
  include AbAdmin::Controllers::Tree

  load_and_authorize_resource

  #has_scope :visible
  #has_scope :un_visible

  protected

  def resource_action_items
    edit_structure = AbAdmin::Config::ActionItem.new({}) { |r| link_to icon('wrench', true), edit_resource_path(r), class: 'btn btn-warning' }
    edit_static_page = AbAdmin::Config::ActionItem.new({}) do |r|
      link_to(icon('pencil', true), edit_structure_record_path(r), class: 'btn btn-primary') if r.structure_type.static_page?
    end
    [edit_static_page, edit_structure, :destroy, :show]
  end

  def tree_node_renderer
    @tree_node_renderer ||= lambda { |r| link_to r.admin_title, edit_structure_record_path(r), class: 'tree-item_link' }
  end

  def settings
    {index_view: 'tree', default_order: 'lft'}
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ab_admin-0.6.1 app/controllers/admin/structures_controller.rb
ab_admin-0.6.0 app/controllers/admin/structures_controller.rb
ab_admin-0.5.0 app/controllers/admin/structures_controller.rb