= focus(@readonly_name ? :node_description : :node_name)

= header_for(form)

.item
  = form.error_messages

  .element
    = form.label :node, "Node"
    - if @readonly_name
      %p
        = h @node.name
    - else
      = form.text_field :name, :placeholder => "Enter the node name here"

  .element.textarea
    = form.label :description
    = form.text_area :description, :rows => 4, :placeholder => "Enter a description for this node here..."

  - if SETTINGS.use_external_node_classification
    .element
      %h3 Parameters
      %table#parameters.inspector
        %tbody
          - if form.object.parameters.blank?
            = render :partial => 'parameters/parameter_input', :object => form.object.parameters.build
          - else
            = render :partial => 'parameters/parameter_input', :collection => form.object.parameters
        %tfoot
          %tr
            %td{:colspan => 2}
              = link_to_function("Add parameter", :class => "add button") { |page|  page.insert_html :bottom, 'parameters', :partial => 'parameters/parameter_input', :object => form.object.parameters.build }

    = render :partial => 'shared/tokenized_text_box',
      :locals => { :model => 'node_class',
        :title => 'Classes',
        :source => 'node' }

  = render :partial => 'shared/tokenized_text_box',
    :locals => {:model => 'node_group',
      :title => 'Groups',
      :source => 'node'}

  %script#tokenizer{:type => "text/javascript"}= tokenize_input_class(@class_data, @group_data)
