foodsoft/app/views/articles/_edit_all_table.html.haml

36 lines
1.6 KiB
Text
Raw Normal View History

2012-10-28 18:03:50 +01:00
%table.table
%thead
%tr
%th= heading_helper Article, :availability, short: true
%th= heading_helper Article, :name
%th= heading_helper Article, :unit
%th= heading_helper Article, :price, short: true
%th= heading_helper Article, :unit_quantity, short: true
%th= heading_helper Article, :order_number, short: true
%th= heading_helper Article, :note
%th= heading_helper Article, :article_category
%th= heading_helper Article, :tax
%th= heading_helper Article, :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
%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(", ")