<div class="page-header">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
    <li class="breadcrumb-item"><a href="<%= settings_menu_category_simple_menu_item_path(@category,@item) %>"><%= t("views.right_panel.header.menu_item_instances") %></a></li>
    <li class="breadcrumb-item active"><%= t("views.btn.new") %></li>
    <span class="float-right">
      <%= link_to 'Back', settings_menu_category_simple_menu_item_path(@category,@item) %>
    </span>
  </ol>
</div>
<br>
<%= render 'form', settings_simple_menu_item_menu_item_instances: @settings_menu_item_instances, item_sets: @item_sets %>

<script>
  $(document).ready(function(){
    attr_type = <%= raw @item.item_attributes.to_json %>;
    attr_id = [];
    $.each(attr_type, function(k, v) {
      option = $('.' + k + ' option:selected').val();
      attr_id.push(option);
    });
    $('#attr_type').val(JSON.stringify(attr_id));
  })
</script>
