Add percent sign for tax in forms

This commit is contained in:
Julius 2013-06-06 17:58:02 +02:00
parent 53518039f1
commit 0f4614eb31
6 changed files with 26 additions and 11 deletions

View file

@ -27,8 +27,10 @@
%td= form.text_field 'note', class: 'input-medium' %td= form.text_field 'note', class: 'input-medium'
%td= form.collection_select 'article_category_id', ArticleCategory.all, %td= form.collection_select 'article_category_id', ArticleCategory.all,
:id, :name, { :include_blank => true }, class: 'input-small' :id, :name, { :include_blank => true }, class: 'input-small'
%td= form.text_field 'tax', class: 'input-mini' %td.input-append
= form.text_field 'tax', class: 'input-mini'
%span.add-on %
%td= form.text_field 'deposit', class: 'input-mini' %td= form.text_field 'deposit', class: 'input-mini'
- unless article.errors.empty? - unless article.errors.empty?
%tr.alert %tr.alert
%td(colspan="10")= article.errors.full_messages.join(", ") %td(colspan="10")= article.errors.full_messages.join(", ")

View file

@ -16,7 +16,9 @@
= f.input :price = f.input :price
= f.input :unit_quantity = f.input :unit_quantity
= f.input :order_number = f.input :order_number
= f.input :tax = f.input :tax, :wrapper => :append do
= f.input_field :tax
%span.add-on %
= f.input :deposit = f.input :deposit
.modal-footer .modal-footer
= button_tag "Schließen", class: 'btn', data: {dismiss: 'modal'} = button_tag "Schließen", class: 'btn', data: {dismiss: 'modal'}

View file

@ -63,11 +63,14 @@
%td{:style => highlight_new(attrs, :unit)}= form.text_field 'unit', class: 'input-mini' %td{:style => highlight_new(attrs, :unit)}= form.text_field 'unit', class: 'input-mini'
%td{:style => highlight_new(attrs, :unit_quantity)}= form.text_field 'unit_quantity', class: 'input-mini' %td{:style => highlight_new(attrs, :unit_quantity)}= form.text_field 'unit_quantity', class: 'input-mini'
%td{:style => highlight_new(attrs, :price)}= form.text_field 'price', class: 'input-mini' %td{:style => highlight_new(attrs, :price)}= form.text_field 'price', class: 'input-mini'
%td{:style => highlight_new(attrs, :tax)}= form.text_field 'tax', class: 'input-mini' %td{:style => highlight_new(attrs, :tax)}.input-append
= form.text_field 'tax', class: 'input-mini'
%span.add-on %
-# untested, because database is not set up locally!
%td{:style => highlight_new(attrs, :deposit)}= form.text_field 'deposit', class: 'input-mini' %td{:style => highlight_new(attrs, :deposit)}= form.text_field 'deposit', class: 'input-mini'
%td= form.select :article_category_id, ArticleCategory.all.map {|a| [ a.name, a.id ] }, %td= form.select :article_category_id, ArticleCategory.all.map {|a| [ a.name, a.id ] },
{include_blank: true}, class: 'input-small' {include_blank: true}, class: 'input-small'
%hr/ %hr/
= hidden_field 'supplier', 'id' = hidden_field 'supplier', 'id'
= submit_tag 'Alle löschen/aktualisieren', class: 'btn btn-primary' = submit_tag 'Alle löschen/aktualisieren', class: 'btn btn-primary'
= link_to 'oder abbrechen', supplier_articles_path(@supplier) = link_to 'oder abbrechen', supplier_articles_path(@supplier)

View file

@ -5,7 +5,10 @@
= f.input :unit = f.input :unit
= f.input :note = f.input :note
= f.input :price = f.input :price
= f.input :tax = f.input :tax, :wrapper => :append do
= f.input_field :tax
%span.add-on %
-# untested, because this view is currently not included (?)
= f.input :deposit = f.input :deposit
= f.association :article_category = f.association :article_category
= f.submit class: 'btn' = f.submit class: 'btn'

View file

@ -4,7 +4,10 @@
= f.input :unit = f.input :unit
= f.input :note = f.input :note
= f.input :price = f.input :price
= f.input :tax = f.input :tax, :wrapper => :append do
= f.input_field :tax
%span.add-on %
-# untested, because this view is currently not included (?)
= f.input :deposit = f.input :deposit
= f.association :article_category = f.association :article_category
= f.submit = f.submit

View file

@ -6,7 +6,9 @@
- if stock_article.new_record? - if stock_article.new_record?
= f.input :price = f.input :price
= f.input :tax = f.input :tax, :wrapper => :append do
= f.input_field :tax
%span.add-on %
= f.input :deposit = f.input :deposit
- else - else
= f.input :price, :input_html => {:disabled => 'disabled'}, = f.input :price, :input_html => {:disabled => 'disabled'},
@ -14,4 +16,4 @@
= f.association :article_category = f.association :article_category
.form-actions .form-actions
= f.submit class: 'btn' = f.submit class: 'btn'
= link_to "oder abbrechen", stock_articles_path = link_to "oder abbrechen", stock_articles_path