engine/app/views/admin/custom_fields/edit_category.html.haml

43 lines
1.6 KiB
Plaintext

#edit-custom-field-category
.inner
%h2!= t('.title')
%p!= t('.help')
= semantic_form_for @field, :as => :custom_field, :url => admin_custom_field_url(@parent.model_name.underscore, @parent.slug, @field) do |f|
= f.foldable_inputs :name => t('.collection_label'), :class => 'editable-list off' do
- @field.ordered_category_items.each do |item|
= f.fields_for :category_items, item, :child_index => item._index do |g|
%li{ :class => "item added #{'error' unless item.errors.empty?}"}
%span.handle
= image_tag 'admin/form/icons/drag.png'
= g.hidden_field :position, :class => 'position'
= g.text_field :name
 
%span.actions
= link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove', :confirm => t('admin.messages.confirm')
= f.fields_for :category_items, @field.category_items.build, :child_index => '-1' do |g|
%li{ :class => 'item template' }
%span.handle
= image_tag 'admin/form/icons/drag.png'
= g.hidden_field :position, :class => 'position'
= g.text_field :name, :class => 'string name'
 
%span.actions
= link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove', :confirm => t('admin.messages.confirm')
%button{ :class => 'button light add', :type => 'button' }
%span!= t('admin.buttons.new_item')
.popup-actions
%p
%button.button.light{ :type => 'button' }
%span!= t('admin.shared.form_actions.update')