2012-10-28 18:03:50 +01:00
|
|
|
%table.table
|
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th
|
2013-03-22 00:20:30 +01:00
|
|
|
%acronym{:title => t('.available_desc')}= t '.available_short'
|
|
|
|
%th= t 'simple_form.labels.article.name'
|
|
|
|
%th= t 'simple_form.labels.article.unit'
|
2012-10-28 18:03:50 +01:00
|
|
|
%th
|
2013-03-22 00:20:30 +01:00
|
|
|
%acronym{:title => t('.price_desc')}= t '.price_short'
|
2012-10-28 18:03:50 +01:00
|
|
|
%th
|
2013-03-22 00:20:30 +01:00
|
|
|
%acronym{:title => t('.unit_quantity_desc')}= t '.unit_quantity_short'
|
|
|
|
%th
|
|
|
|
%acronym{:title => t('.order_number_desc')}= t '.order_number_short'
|
|
|
|
%th= t 'simple_form.labels.article.note'
|
|
|
|
%th= t 'simple_form.labels.article.article_category'
|
|
|
|
%th= t 'simple_form.labels.defaults.tax'
|
|
|
|
%th= t 'simple_form.labels.defaults.deposit'
|
2012-10-28 18:03:50 +01:00
|
|
|
%tbody
|
|
|
|
- @articles.each_with_index do |article, index|
|
|
|
|
= fields_for "articles[#{article.id || index}]", article do |form|
|
|
|
|
%tr
|
2013-07-06 17:48:40 +02:00
|
|
|
%td
|
|
|
|
= yield form # allow to add hidden fields to form
|
|
|
|
= form.check_box 'availability'
|
2012-10-28 18:03:50 +01:00
|
|
|
%td= form.text_field 'name', class: 'input-medium'
|
|
|
|
%td= form.text_field 'unit', class: 'input-mini'
|
|
|
|
%td= form.text_field 'price', class: 'input-mini'
|
|
|
|
%td= form.text_field 'unit_quantity', class: 'input-mini'
|
|
|
|
%td= form.text_field 'order_number', class: 'input-mini'
|
|
|
|
%td= form.text_field 'note', class: 'input-medium'
|
|
|
|
%td= form.collection_select 'article_category_id', ArticleCategory.all,
|
|
|
|
:id, :name, { :include_blank => true }, class: 'input-small'
|
2013-06-06 17:58:02 +02:00
|
|
|
%td.input-append
|
|
|
|
= form.text_field 'tax', class: 'input-mini'
|
|
|
|
%span.add-on %
|
2012-10-28 18:03:50 +01:00
|
|
|
%td= form.text_field 'deposit', class: 'input-mini'
|
|
|
|
- unless article.errors.empty?
|
|
|
|
%tr.alert
|
2013-03-22 00:20:30 +01:00
|
|
|
%td(colspan="10")= article.errors.full_messages.join(", ")
|