Class: Releaf::Content::Nodes::ToolboxBuilder

Inherits:
Builders::ToolboxBuilder
  • Object
show all
Defined in:
app/builders/releaf/content/nodes/toolbox_builder.rb

Instance Method Summary collapse

Instance Method Details

#add_child_buttonObject



15
16
17
# File 'app/builders/releaf/content/nodes/toolbox_builder.rb', line 15

def add_child_button
  button(t('Add child'), nil, class: "ajaxbox", href: url_for(action: "content_type_dialog", parent_id: resource.id))
end

#copy_buttonObject



19
20
21
# File 'app/builders/releaf/content/nodes/toolbox_builder.rb', line 19

def copy_button
  button(t('Copy'), nil, class: "ajaxbox", href: url_for(action: "copy_dialog", id: resource.id))
end

#itemsObject



3
4
5
6
7
8
9
10
11
12
13
# File 'app/builders/releaf/content/nodes/toolbox_builder.rb', line 3

def items
  list = []

  unless resource.new_record?
    list << add_child_button
    list << copy_button
    list << move_button
  end

  list + super
end

#move_buttonObject



23
24
25
# File 'app/builders/releaf/content/nodes/toolbox_builder.rb', line 23

def move_button
  button(t('Move'), nil, class: "ajaxbox", href: url_for(action: "move_dialog", id: resource.id))
end