<%= unless @relation.new_record? link_to_remote _('btn_x'), :url => relation_path(@relation), :method => :get else link_to_function _('btn_x'), "['add_relation', 'add_relation_form'].each(Element.toggle)" end %>
<%= error_messages_for(@relation) %>
<% unless @relation.new_record? %> <%= form_remote_tag(:url => relation_path(@relation), :method => :put ) %> <% else %> <%= form_remote_tag(:url => relations_path ) %> <% end %>
<%= _('source') %><%= _('target') %>
<%= _('kpath') %> <%= select('relation', 'source_kpath', Node.kpaths_for_form ) %> <%= select('relation', 'target_kpath', Node.kpaths_for_form ) %>
<%= _('role') %> <%= text_field('relation', 'source_role', :size=>18 ) %> <%= text_field('relation', 'target_role', :size=>18 ) %>
<%= _('icon') %> <%= text_field('relation', 'source_icon', :size=>18 ) %> <%= text_field('relation', 'target_icon', :size=>18 ) %>
<%= _('type') %> <%= radio_button("relation", "source_unique", true) %> <%= _('relation_img') %> <%= radio_button("relation", "source_unique", false) %> <%= _('relations_img') %> <%= radio_button("relation", "target_unique", true) %> <%= _('relation_img') %> <%= radio_button("relation", "target_unique", false) %> <%= _('relations_img') %>

'/>

<% unless @relation.new_record? -%> <%= form_remote_tag(:url => relation_path(@relation), :method => :delete, :confirm => _('Are you sure you want to destroy this relation ?') ) %>

<%= _('destroy relation (with all links)') %> '>

<% end -%>