Class: Releaf::Content::Nodes::IndexBuilder

Inherits:
Builders::IndexBuilder
  • Object
show all
Includes:
Builders::Toolbox, Builders::Tree
Defined in:
app/builders/releaf/content/nodes/index_builder.rb

Instance Method Summary collapse

Methods included from Builders::Tree

#body_classes, #build_tree, #empty_body, #root_level, #section_body, #sort_tree, #sorted_tree, #tree, #tree_level, #tree_resource, #tree_resource_children, #tree_resource_collapser, #tree_resource_name, #tree_resource_name_button

Instance Method Details

#pagination?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'app/builders/releaf/content/nodes/index_builder.rb', line 16

def pagination?
  false
end

#resource_creation_buttonObject



20
21
22
# File 'app/builders/releaf/content/nodes/index_builder.rb', line 20

def resource_creation_button
  button(t("Create new resource"), "plus", class: %w(primary ajaxbox), href: url_for(controller: controller.controller_name, action: "content_type_dialog"))
end

#tree_resource_blocks(resource, level, expanded) ⇒ Object



6
7
8
# File 'app/builders/releaf/content/nodes/index_builder.rb', line 6

def tree_resource_blocks(resource, level, expanded)
  [tree_resource_toolbox(resource)] + super
end

#tree_resource_toolbox(resource) ⇒ Object



10
11
12
13
14
# File 'app/builders/releaf/content/nodes/index_builder.rb', line 10

def tree_resource_toolbox(resource)
  tag(:div, class: "only-icon toolbox-cell") do
    toolbox(resource[:node], index_path: index_path)
  end
end