<%= form_with(model: node, local: true) do |form| %>
  <%# if node.errors.any? %>
<!--    <div id="error_explanation">-->
<!--      <h2><%#= pluralize(node.errors.count, "error") %> prohibited this node from being saved:</h2>-->

<!--      <ul>-->
        <%# node.errors.full_messages.each do |message| %>
<!--          <li><%#= message %></li>-->
        <%# end %>
<!--      </ul>-->
<!--    </div>-->
  <%# end %>
  <div class="form-group ">
    <label for="status">节点分类：</label>
    <%= form.select :action_node_types_id, options_for_select(Action::NodeType.all.map { |key| [key.name, key.id]}, node.action_node_types_id), {}, class: "form-control" %>
  </div>
  <div class="field">
    <%= form.label :label, "节点名称" %>
    <%= form.text_field :label %>
  </div>
  <div class="field">
    <%= form.label :name, "节点标识" %>
    <%= form.text_field :name %>
  </div>
  <div class="field">
    <%= form.label :full_name, "节点全名" %>
    <%= form.text_field :full_name %>
  </div>
  <div class="form-group ">
    <label for="status">类型：</label>
    <% node_type_options = [['action节点', 'step' ], ['启动', 'start' ], ['任务', 'job']] %>
    <%= form.select :node_type, options_for_select(node_type_options, node.node_type), {}, class: "form-control" %>
  </div>
  <div class="form-group ">
    <label for="status">是否支持分支：</label>
    <% is_mutil_link_options = [['否', false ], ['是', true]] %>
    <%= form.select :is_mutil_link, options_for_select(is_mutil_link_options, node.is_mutil_link), {}, class: "form-control" %>
  </div>
  <div class="form-group ">
    <label for="status">可连接到类型：</label>
    <% link_type_options = [Action::Node.new(name: "job", label: "任务"), Action::Node.new(name: "step", label: "action节点")] %>
    <%= collection_check_boxes(:node, :link_type_array, link_type_options, :name, :label) %>
  </div>


  <div class="field">
    <%= form.label :description, "描述" %>
    <%= form.text_area :description, rows: 5, :style => 'width:800px;' %>
  </div>

  <div class="field">
    <%= form.label :icon, "Icon图标" %>
    <%= form.text_field :icon %>
  </div>

  <div class="field">
    <%= form.label :is_local, "是否本地化" %>
    <%= form.check_box("is_local", {}, "true", "false") %>
  </div>

  <div class="field">
    <%= form.label :local_url, "本地化地址" %>
    <%= form.text_field :local_url, :style => 'width:1200px;' %>
  </div>



  <div class="field">
    <%= form.label :sort_no, "排序号" %>
    <%= form.text_field :sort_no %>
  </div>

  <div class="field">
    <%= form.label :yaml, "yaml语法代码" %>
    <%= form.text_area :yaml, rows: 5, :style => 'width:1200px;' %>
  </div>

  <div class="actions" style="margin-top:10px;">
    <!--    <a href="/managements/competition/customize" style="font-size: 28px;">>>前往节点管理页面</a>-->
    <%= form.submit("保存") %>
  </div>
<% end %>
