= form_for @product, :html => {:multipart => true} do |f| = f.error_messages = field_set_tag t('shoppe.products.product_information') do %dl %dt= f.label :product_categories, t('shoppe.product_category.product_categories') %dd= f.collection_select :product_category_ids, Shoppe::ProductCategory.ordered, :id, :name, {:prompt => false}, {:class => 'chosen', :multiple => true, :data => {:placeholder => t('shoppe.product_category.choose_product_category') }} .splitContainer %dl.third %dt= f.label :name, t('shoppe.products.name') %dd= f.text_field :name, :class => 'text focus' %dl.third %dt= f.label :permalink, t('shoppe.products.permalink') %dd= f.text_field :permalink, :class => 'text' %dl.third %dt= f.label :sku, t('shoppe.products.sku') %dd= f.text_field :sku, :class => 'text' %dl %dt= f.label :description, t('shoppe.products.description') %dd= f.text_area :description, :class => 'text' %dl %dt= f.label :short_description, t('shoppe.products.short_description') %dd= f.text_area :short_description, :class => 'text' %dl %dt= f.label :in_the_box, t('shoppe.products.in_the_box') %dd= f.text_area :in_the_box, :class => 'text' = field_set_tag t('shoppe.products.attributes') do .margin %table.productAttributes %thead %tr %td= t('shoppe.products.name') %td= t('shoppe.products.value') %td.searchable= t('shoppe.products.searchable?') %td.searchable= t('shoppe.products.public?') %td.remove= t('shoppe.products.remove') %td %tbody %tr.template{:style => 'display:none;'} %td= text_field_tag 'product[product_attributes_array][][key]', '', :placeholder => t('shoppe.products.name') %td= text_field_tag 'product[product_attributes_array][][value]', '', :placeholder => t('shoppe.products.value') %td.searchable= check_box_tag 'product[product_attributes_array][][searchable]', '1' %td.searchable= check_box_tag 'product[product_attributes_array][][public]', '1' %td.remove= link_to t('shoppe.remove') , '#', :class => 'button button-mini purple' %td.handle - for attribute in @product.product_attributes %tr %td= text_field_tag 'product[product_attributes_array][][key]', attribute.key, :placeholder => t('shoppe.products.name') %td= text_field_tag 'product[product_attributes_array][][value]', attribute.value, :placeholder => t('shoppe.products.value') %td.searchable= check_box_tag 'product[product_attributes_array][][searchable]', '1', attribute.searchable? %td.searchable= check_box_tag 'product[product_attributes_array][][public]', '1', attribute.public? %td.remove= link_to t("shoppe.remove"), '#', :class => 'button button-mini purple' %td.handle %p.addAttribute= link_to t('shoppe.products.add_attribute') , '#', :data => {:behavior => 'addAttributeToAttributesTable'}, :class => 'button button-mini green' = field_set_tag t('shoppe.products.attachments') do .splitContainer %dl.half %dt= f.label :default_image_file, t('shoppe.products.default_image') %dd = attachment_preview @product.default_image %p= f.file_field :default_image_file %dl.half %dt= f.label :data_sheet_file, t('shoppe.products.datasheet') %dd = attachment_preview @product.data_sheet %p= f.file_field :data_sheet_file - unless @product.has_variants? = field_set_tag t('shoppe.products.pricing') do .splitContainer %dl.third %dt= f.label :price, t('shoppe.products.price') %dd .moneyInput .currency= Shoppe.settings.currency_unit.html_safe = f.text_field :price, :class => 'text' %dl.third %dt= f.label :cost_price, t('shoppe.products.cost_price') %dd .moneyInput .currency= Shoppe.settings.currency_unit.html_safe = f.text_field :cost_price, :class => 'text' %dl.third %dt= f.label :tax_rate_id, t('shoppe.products.tax_rate') %dd= f.collection_select :tax_rate_id, Shoppe::TaxRate.ordered, :id, :description, {:include_blank => true}, {:class => 'chosen-with-deselect', :data => {:placeholder => t('shoppe.products.no_tax')}} = field_set_tag t('shoppe.products.stock_control') do .splitContainer %dl.half %dt= f.label :weight, t('shoppe.products.weight') %dd= f.text_field :weight, :class => 'text' %dl.half %dt= f.label :stock_control, t('shoppe.products.stock_control') %dd.checkbox = f.check_box :stock_control = f.label :stock_control, t('shoppe.products.enable_stock_control?') = field_set_tag t('shoppe.products.website_properties') do .splitContainer %dl.half %dt= f.label :active, t('shoppe.products.on_sale?') %dd.checkbox = f.check_box :active = f.label :active, t('shoppe.products.on_sale_info') %dl.half %dt= f.label :featured, t('shoppe.products.featured?') %dd.checkbox = f.check_box :featured = f.label :featured, t('shoppe.products.featured_info') %p.submit - unless @product.new_record? %span.right= link_to t('shoppe.delete') , @product, :class => 'button purple', :method => :delete, :data => {:confirm => "Are you sure you wish to remove this product?"} = f.submit t('shoppe.submit'), :class => 'button green' = link_to t('shoppe.cancel'), :products, :class => 'button'