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



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

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



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

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

#go_to_buttonObject



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

def go_to_button
  button(t('Go to'), nil, class: "ajaxbox", href: url_for(action: "go_to_dialog"))
end

#itemsObject



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

def items
  list = []

  unless resource.new_record?
    list << add_child_button
    list << go_to_button unless params[:context] == "index"
    list << copy_button
    list << move_button
  end

  list + super
end

#move_buttonObject



28
29
30
# File 'app/builders/releaf/content/nodes/toolbox_builder.rb', line 28

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