<% if @nav_item.errors.any? %>

Please correct the following errors::

<% @nav_item.errors.to_a.in_groups(2, false).each do |group| %> <% end %>

<% end %>
<%= legend_tag 'Navigation Link Details' -%>
<%= f.hidden_field :parent_id, :value => params[:parent_id] unless params[:parent_id].blank? -%> <%= f.hidden_field :creating_page, :value => params[:creating_page] unless params[:creating_page].blank? -%> <%= f.text_field :link_text, :help => 'The text that appears as part of the link.' -%> <%= f.text_field :link_title, :help => 'This description appears in the mouseover for the link.' -%> <%= f.text_field :url, :value => @nav_item.decoded_url, :label => 'URL' -%> <%= f.check_box :obfuscate, :label => 'Visibility', :inline_label => 'Hide from search engine spiders' -%>
<%= f.select :kind, NavItem::KINDS, :label => 'Navigation Item Kind', :include_blank => 'Select...' unless @nav_item.parent_id -%>
<%- if params[:parent_id] -%> <%= f.hidden_field :parent_id, :value => @nav_item.parent_id -%> <%= f.hidden_field :kind, :value => @nav_item.parent.kind -%> <%- elsif @nav_item.new_record? || @nav_item.kind == "Secondary" -%> <%= f.select :parent_id, @root_links.map{|r| ["#{r.link_text} (#{r.kind} Link)", r.id]}, :label => 'Parent Navigation Link', :include_blank => 'None' -%> <%- if @nav_item.parent_id -%> <%= f.hidden_field :parent_id, :value => @nav_item.parent_id -%> <%= f.hidden_field :kind, :value => @nav_item.parent.kind -%> <%- end -%> <%- end -%>


<%- unless @nav_item.parent_id -%> <%- end -%>