@@ -1,47 +1,47 | |||
|
1 | 1 | <%= custom_field_title @custom_field %> |
|
2 | 2 | |
|
3 | 3 | <% if @custom_field.enumerations.any? %> |
|
4 | 4 | <%= form_tag custom_field_enumerations_path(@custom_field), :method => 'put' do %> |
|
5 | 5 | <div class="box"> |
|
6 | 6 | <ul id="custom_field_enumerations" class="flat"> |
|
7 | 7 | <% @custom_field.enumerations.each_with_index do |value, position| %> |
|
8 | 8 | <li> |
|
9 |
<span class="sort-handle |
|
|
9 | <span class="sort-handle"></span> | |
|
10 | 10 | <%= hidden_field_tag "custom_field_enumerations[#{value.id}][position]", position, :class => 'position' %> |
|
11 | 11 | <%= text_field_tag "custom_field_enumerations[#{value.id}][name]", value.name, :size => 40 %> |
|
12 | 12 | <%= hidden_field_tag "custom_field_enumerations[#{value.id}][active]", 0 %> |
|
13 | 13 | <label> |
|
14 | 14 | <%= check_box_tag "custom_field_enumerations[#{value.id}][active]", 1, value.active? %> |
|
15 | 15 | <%= l(:field_active) %> |
|
16 | 16 | </label> |
|
17 | 17 | <%= delete_link custom_field_enumeration_path(@custom_field, value) %> |
|
18 | 18 | </li> |
|
19 | 19 | <% end %> |
|
20 | 20 | </ul> |
|
21 | 21 | </div> |
|
22 | 22 | <p> |
|
23 | 23 | <%= submit_tag(l(:button_save)) %> | |
|
24 | 24 | <%= link_to l(:button_back), edit_custom_field_path(@custom_field) %> |
|
25 | 25 | </p> |
|
26 | 26 | <% end %> |
|
27 | 27 | <% end %> |
|
28 | 28 | |
|
29 | 29 | <p><%= l(:label_enumeration_new) %></p> |
|
30 | 30 | |
|
31 | 31 | <%= form_tag custom_field_enumerations_path(@custom_field), :method => 'post', :remote => true do %> |
|
32 | 32 | <p><%= text_field_tag 'custom_field_enumeration[name]', '', :size => 40 %> |
|
33 | 33 | <%= submit_tag(l(:button_add)) %></p> |
|
34 | 34 | <% end %> |
|
35 | 35 | |
|
36 | 36 | <%= javascript_tag do %> |
|
37 | 37 | $(function() { |
|
38 | 38 | $("#custom_field_enumerations").sortable({ |
|
39 | 39 | handle: ".sort-handle", |
|
40 | 40 | update: function(event, ui) { |
|
41 | 41 | $("#custom_field_enumerations li").each(function(){ |
|
42 | 42 | $(this).find("input.position").val($(this).index()+1); |
|
43 | 43 | }); |
|
44 | 44 | } |
|
45 | 45 | }); |
|
46 | 46 | }); |
|
47 | 47 | <% end %> |
General Comments 0
You need to be logged in to leave comments.
Login now