From 0f4614eb311ff9a718ed43dc99dbcd33056c42de Mon Sep 17 00:00:00 2001 From: Julius Date: Thu, 6 Jun 2013 17:58:02 +0200 Subject: [PATCH] Add percent sign for tax in forms --- app/views/articles/_edit_all_table.html.haml | 6 ++++-- app/views/articles/_form.html.haml | 4 +++- app/views/articles/sync.html.haml | 7 +++++-- app/views/deliveries/_stock_article_form.html.haml | 7 +++++-- app/views/stock_takings/_stock_article_form.html.haml | 7 +++++-- app/views/stockit/_form.html.haml | 6 ++++-- 6 files changed, 26 insertions(+), 11 deletions(-) diff --git a/app/views/articles/_edit_all_table.html.haml b/app/views/articles/_edit_all_table.html.haml index 3189b27b..f85f4097 100644 --- a/app/views/articles/_edit_all_table.html.haml +++ b/app/views/articles/_edit_all_table.html.haml @@ -27,8 +27,10 @@ %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' - %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' - unless article.errors.empty? %tr.alert - %td(colspan="10")= article.errors.full_messages.join(", ") \ No newline at end of file + %td(colspan="10")= article.errors.full_messages.join(", ") diff --git a/app/views/articles/_form.html.haml b/app/views/articles/_form.html.haml index d87cbf79..3ca28fae 100644 --- a/app/views/articles/_form.html.haml +++ b/app/views/articles/_form.html.haml @@ -16,7 +16,9 @@ = f.input :price = f.input :unit_quantity = f.input :order_number - = f.input :tax + = f.input :tax, :wrapper => :append do + = f.input_field :tax + %span.add-on % = f.input :deposit .modal-footer = button_tag "Schließen", class: 'btn', data: {dismiss: 'modal'} diff --git a/app/views/articles/sync.html.haml b/app/views/articles/sync.html.haml index d297c445..4b7743cb 100644 --- a/app/views/articles/sync.html.haml +++ b/app/views/articles/sync.html.haml @@ -63,11 +63,14 @@ %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, :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= form.select :article_category_id, ArticleCategory.all.map {|a| [ a.name, a.id ] }, {include_blank: true}, class: 'input-small' %hr/ = hidden_field 'supplier', 'id' = submit_tag 'Alle löschen/aktualisieren', class: 'btn btn-primary' - = link_to 'oder abbrechen', supplier_articles_path(@supplier) \ No newline at end of file + = link_to 'oder abbrechen', supplier_articles_path(@supplier) diff --git a/app/views/deliveries/_stock_article_form.html.haml b/app/views/deliveries/_stock_article_form.html.haml index 395be839..757383af 100644 --- a/app/views/deliveries/_stock_article_form.html.haml +++ b/app/views/deliveries/_stock_article_form.html.haml @@ -5,7 +5,10 @@ = f.input :unit = f.input :note = 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.association :article_category - = f.submit class: 'btn' \ No newline at end of file + = f.submit class: 'btn' diff --git a/app/views/stock_takings/_stock_article_form.html.haml b/app/views/stock_takings/_stock_article_form.html.haml index 99898b1a..9e7ec14b 100644 --- a/app/views/stock_takings/_stock_article_form.html.haml +++ b/app/views/stock_takings/_stock_article_form.html.haml @@ -4,7 +4,10 @@ = f.input :unit = f.input :note = 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.association :article_category - = f.submit \ No newline at end of file + = f.submit diff --git a/app/views/stockit/_form.html.haml b/app/views/stockit/_form.html.haml index 0305aefd..c126ad7d 100644 --- a/app/views/stockit/_form.html.haml +++ b/app/views/stockit/_form.html.haml @@ -6,7 +6,9 @@ - if stock_article.new_record? = f.input :price - = f.input :tax + = f.input :tax, :wrapper => :append do + = f.input_field :tax + %span.add-on % = f.input :deposit - else = f.input :price, :input_html => {:disabled => 'disabled'}, @@ -14,4 +16,4 @@ = f.association :article_category .form-actions = f.submit class: 'btn' - = link_to "oder abbrechen", stock_articles_path \ No newline at end of file + = link_to "oder abbrechen", stock_articles_path