Improve upload form

This commit is contained in:
wvengen 2015-03-27 15:19:50 +01:00
parent 16e9210035
commit 0d92007274
2 changed files with 80 additions and 18 deletions

View file

@ -1,20 +1,72 @@
- title t('.title', supplier: @supplier.name)
= t('.body').html_safe
%pre
= [t('.fields.status'),
Article.human_attribute_name(:order_number),
Article.human_attribute_name(:name),
Article.human_attribute_name(:note),
Article.human_attribute_name(:manufacturer),
Article.human_attribute_name(:origin),
Article.human_attribute_name(:unit),
Article.human_attribute_name(:price),
Article.human_attribute_name(:tax),
Article.human_attribute_name(:deposit),
Article.human_attribute_name(:unit_quantity),
t('.fields.reserved'),
t('.fields.reserved'),
Article.human_attribute_name(:article_category)].join(" | ")
%p= t '.text_1', supplier: @supplier.name
%table.table.table-bordered
%thead
%tr
%th= t '.field.status'
%th= Article.human_attribute_name(:order_number)
%th= Article.human_attribute_name(:name)
%th= Article.human_attribute_name(:note)
%th= Article.human_attribute_name(:manufacturer)
%th= Article.human_attribute_name(:origin)
%th= Article.human_attribute_name(:unit)
%th= Article.human_attribute_name(:price)
%th= Article.human_attribute_name(:tax)
%th= Article.human_attribute_name(:deposit)
%th= Article.human_attribute_name(:unit_quantity)
%th.muted= t '.fields.reserved'
%th.muted= t '.fields.reserved'
%th= Article.human_attribute_name(:article_category)
%tbody
%tr
%td
%td 1234A
%td= t '.sample.walnuts'
%td
%td= t '.sample.supplier_1'
%td CA
%td 500 gr
%td 8.90
%td= FoodsoftConfig[:tax_default] || 6
%td 0
%td 6
%td
%td
%td= t '.sample.nuts'
%tr
%td x
%td 4321Z
%td= t '.sample.tomato_juice'
%td= t '.sample.organic'
%td= t '.sample.supplier_2'
%td IN
%td 1.5 l
%td 4.35
%td= FoodsoftConfig[:tax_default] || 6
%td 0
%td 1
%td
%td
%td= t '.sample.juices'
%tr
%td
%td 4322Q
%td= t '.sample.tomato_juice'
%td= t '.sample.organic'
%td= t '.sample.supplier_3'
%td TR
%td 1.2 l
%td 4.02
%td= FoodsoftConfig[:tax_default] || 6
%td 0
%td 2
%td
%td
%td= t '.sample.juices'
%p= t '.text_2'
= form_for :articles, :url => parse_upload_supplier_articles_path(@supplier),
:html => { :multipart => true } do |f|

View file

@ -434,13 +434,23 @@ en:
other: There are %{count} articles to add.
title: Add new ...
upload:
body: <p>The file has to be a text file with the ending <tt>.csv</tt>. The first line will be ignored when imported, fields are separated by semicolons (';'), and text may be enclosed by double quotation marks ("text..."). Default character-set is utf-8.</p> <p>Column order:</p>
fields:
reserved: "(Reserved)"
status: Status (x=skip)
file_label: Please choose a compatible file
sample:
juices: Juices
nuts: Nuts
organic: Organic
supplier_1: Nuttyfarm
supplier_2: Brownfields
supplier_3: Greenfields
tomato_juice: Tomato juice
walnuts: Walnuts
submit: Upload file
title: "%{supplier} / upload articles"
text_1: 'Here you can upload a spreadsheet to update the articles of %{supplier}. Excel (xls, xlsx) and OpenOffice (ods) spreadsheets are accepted, as well as comma-separated files (csv, columns separated by ";" with utf-8 encoding). Only the first sheet will be imported, and columns must be in the following order:'
text_2: 'The rows shown here are examples. When there is an "x" in the first column, the article is outlisted and will be removed. This allows you to edit the spreadsheet and quickly remove many articles at once, for example when articles become unavailable with the supplier. The category will be matched to your Foodsoft category list (both by category name and import names).'
title: "Upload articles of %{supplier}"
config:
hints:
applepear_url: Website where the apple and pear system for tasks is explained.