<%= 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, :object => @relation) %>
<% unless @relation.new_record? %> <%= form_remote_tag(:url => relation_path(@relation), :method => :put ) %> <% else %> <%= form_remote_tag(:url => relations_path ) %> <% end %>
<%= _('forward') %><%= _('inverse') %>
<%= _('class') %> <%= select('relation', 'source_kpath', Node.kpaths_for_form ) %> <%= select('relation', 'target_kpath', Node.kpaths_for_form ) %>
<%= _('type') %> <%= radio_button("relation", "target_unique", true , :checked => @relation.target_unique?) %> <%= _('has_one') %> <%= radio_button("relation", "target_unique", false, :checked => !@relation.target_unique?) %> <%= _('has_many') %> <%= radio_button("relation", "source_unique", true , :checked => @relation.source_unique?) %> <%= _('has_one') %> <%= radio_button("relation", "source_unique", false, :checked => !@relation.source_unique?) %> <%= _('has_many') %>
<%= _('role') %> <%= text_field('relation', 'target_role', :size=>18 ) %> <%= text_field('relation', 'source_role', :size=>18 ) %>
<%= _('icon') %> <%= text_field('relation', 'target_icon', :size=>18 ) %> <%= text_field('relation', 'source_icon', :size=>18 ) %>

'/>

<% 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 -%>