%= custom_field_title @custom_field %> <% if @custom_field.enumerations.any? %> <%= form_tag custom_field_enumerations_path(@custom_field), :method => 'put' do %>
<%= submit_tag(l(:button_save)) %> | <%= link_to l(:button_back), edit_custom_field_path(@custom_field) %>
<% end %> <% end %> <%= form_tag custom_field_enumerations_path(@custom_field), :method => 'post', :remote => true, id: 'add-element' do %><%= l(:label_enumeration_new) %>
<%= text_field_tag 'custom_field_enumeration[name]', '', :size => 40 %> <%= submit_tag(l(:button_add)) %>
<% end %> <%= javascript_tag do %> $(function() { $("#custom_field_enumerations").sortable({ handle: ".sort-handle", update: function(event, ui) { $("#custom_field_enumerations li").each(function(){ $(this).find("input.position").val($(this).index()+1); }); } }); }); <% end %>