<% cocoon_template ||= false %>
<% index ||= 0 %>
<% if cocoon_template && is_top_item %>
<div class="top-item">
<% end %>

<div class="nested-fields splitcontent">

  <div class="splitcontentleft size-3">
    <p>
      <%= f.text_field :name %>
    </p>
  </div>

  <div class="splitcontentleft size-3">
    <p><%= f.text_field :url, :placeholder => '/issues' %></p>
  </div>

  <div class="splitcontentleft size-2 easy-custom-menu-easy-icon-select">
    <p><%= f.easy_icon_select(:easy_icon) %></p>
  </div>

  <div class="splitcontentright size-2 text-right">
    <% if is_top_item %>
      <%= link_to_add_association '', f, :submenus, :class => 'icon icon-add button-icon-only', :partial => 'easy_custom_menus/easy_custom_menu_fields', :render_options => { :locals => { :is_top_item => false, :cocoon_template => true, :index => (index + 1) }},
        :'data-association-insertion-method'    => 'append',
        :'data-association-insertion-node'      => '.top-item',
        :'data-association-insertion-traversal' => 'closest' %>
      <%= link_to_remove_association '', f, :wrapper_class => 'top-item', :class => 'icon icon-del button-icon-only', :title => l(:button_delete) %>
    <% else %>
      <%= link_to_remove_association '', f, :class => 'icon icon-del button-icon-only', :title => l(:button_delete) %>
    <% end %>

  </div>
</div>

<% if cocoon_template && is_top_item %>

</div>
<% end %>
