2011-07-01 00:15:45 +00:00
|
|
|
= form.custom_input field._alias.to_sym, :label => field.label, :hint => field.hint, :css => 'has-many', :required => required do
|
2011-05-19 16:00:45 +00:00
|
|
|
|
|
|
|
.has-many-selector
|
|
|
|
|
|
|
|
%p{ :style => form.object.send(field._alias.to_sym).empty? ? '' : 'display: none' }
|
|
|
|
= t('.empty')
|
|
|
|
|
|
|
|
%ul
|
|
|
|
|
|
|
|
%script{ :type => 'text/x-mustache-template', :name => 'template', :'data-base-input-name' => "content[#{field._alias.to_sym}]" }
|
|
|
|
%li{ :class => "item {{behaviour_flag}}" }
|
|
|
|
%span.handle
|
|
|
|
= image_tag 'admin/form/icons/drag.png'
|
|
|
|
|
|
|
|
{{^if_template}}
|
|
|
|
%input{ :name => '{{base_name}}[]', :value => '{{{id}}}', :type => 'hidden', :'data-field' => 'id' }
|
|
|
|
{{/if_template}}
|
|
|
|
|
|
|
|
%strong {{label}}
|
|
|
|
|
|
|
|
{{#if_template}}
|
|
|
|
= select_tag 'label', ''
|
|
|
|
{{/if_template}}
|
|
|
|
|
|
|
|
%span.actions
|
2011-08-11 20:45:46 +00:00
|
|
|
- if field.reverse_lookup?
|
|
|
|
= link_to image_tag('admin/form/pen.png'), '#', :class => 'edit first'
|
2011-05-19 16:00:45 +00:00
|
|
|
= link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove'
|
|
|
|
%button{ :class => 'button light mini add', :type => 'button' }
|
|
|
|
%span!= t('admin.buttons.new_item')
|
|
|
|
|
|
|
|
%script{ :type => 'text/javascript', :name => 'data' }
|
2011-08-11 20:45:46 +00:00
|
|
|
!= has_many_data_to_js(field, form.object)
|