|
16 | 16 | .controls
|
17 | 17 | =f.select :parent_id, :options=>(Category.all - [@category]).map{|c| [c.name,c.id]},:include_blank=>true,:class => 'form-control input-large input-with-feedback'
|
18 | 18 | %span.help-inline=error ? f.error_message_on(:parent_id, :class => 'text-error') : pat(:example)
|
| 19 | +- error = @category.errors.include?(:item_order) |
| 20 | +%fieldset.control-group{:class => error ? 'has-error' : ''} |
| 21 | + =f.label :item_order, :class => 'control-label' |
| 22 | + .controls |
| 23 | + =f.text_field :item_order, :type => :number, :class => 'form-control input-large input-with-feedback' |
| 24 | + %span.help-inline=error ? f.error_message_on(:item_order, :class => 'text-error') : pat(:example) |
19 | 25 | %fieldset.control-group{:class => error ? 'has-error' : ''}
|
20 | 26 | =f.label :link, :class => 'control-label'
|
21 | 27 | .controls
|
|
28 | 34 | =f.submit pat(:save_and_continue), :class => 'btn btn-info', :name => 'save_and_continue'
|
29 | 35 |
|
30 | 36 | =link_to pat(:cancel), url(:categories, :index), :class => 'btn btn-default'
|
31 |
| - |
| 37 | + |
32 | 38 | %h2 Child Order
|
33 | 39 | %p Drag each child to reorder. To add children, drag them from the list below.
|
34 | 40 |
|
35 | 41 |
|
36 | 42 | .sortable-list-section
|
37 | 43 | %h3
|
38 |
| - Children of Category |
| 44 | + Children of Category |
39 | 45 | %span.italic= @category.name
|
40 | 46 | %ul.category-child-order.reorderable{ data: { url: url_for(:categories, :update, id: @category.id) }, style: "border: 3px solid #ccc" }
|
41 | 47 | - @category.children.each do |child|
|
42 |
| - -#%li{ data: {id: child.id} }= link_to child.name, url(:categories, :edit, id: child.id) |
43 |
| - %li.btn.btn-default.btn-lg.btn-block{ data: {id: child.id} }= link_to child.name, url(:categories, :edit, id: child.id) |
| 48 | + -#%li{ data: {id: child.id} }= link_to child.name, url(:categories, :edit, id: child.id) |
| 49 | + %li.btn.btn-default.btn-lg.btn-block{ data: {id: child.id} }= link_to child.name, url(:categories, :edit, id: child.id) |
44 | 50 |
|
45 | 51 | .sortable-list-section
|
46 | 52 | %h3 All Categories
|
47 | 53 | %ul.category-all-order.reorderable{data: { url: url_for(:categories,:update, id: @category.id)}, style: "border: 3px solid #ccc"}
|
48 | 54 | - (Category.all - @category.children).each do |category|
|
49 |
| - %li.btn.btn-default.btn-lg.btn-block{ data: {id: category.id} }= link_to category.name, url(:categories, :edit, id: category.id) |
50 |
| - |
| 55 | + %li.btn.btn-default.btn-lg.btn-block{ data: {id: category.id} }= link_to category.name, url(:categories, :edit, id: category.id) |
0 commit comments