add modal to choose column order for custom csv file

This commit is contained in:
viehlieb 2023-02-14 16:51:22 +01:00
parent fb8ccfea4a
commit eba84b2e15
7 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,15 @@
= simple_form_for :custom_csv,format: :csv, :url => order_path(@order, view: @view, format: :csv), method: :get do |f|
.modal-header
= close_button :modal
.h3=I18n.t('.orders.custom_csv.description')
.modal-body
= f.input :first, as: :select, collection: custom_csv_collection, label: "1. " + I18n.t('.orders.custom_csv.column')
= f.input :second, as: :select, collection: custom_csv_collection, required: false, label: "2. " + I18n.t('.orders.custom_csv.column')
= f.input :third, as: :select, collection: custom_csv_collection, required: false, label: "3. " + I18n.t('.orders.custom_csv.column')
= f.input :fourth, as: :select, collection: custom_csv_collection, required: false, label: "4. " + I18n.t('.orders.custom_csv.column')
= f.input :fifth, as: :select, collection: custom_csv_collection, required: false, label: "5. " + I18n.t('.orders.custom_csv.column')
= f.input :sixth, as: :select, collection: custom_csv_collection, required: false, label: "6. " + I18n.t('.orders.custom_csv.column')
= f.input :seventh, as: :select, collection: custom_csv_collection, required: false, label: "7. " + I18n.t('.orders.custom_csv.column')
.modal-footer
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
= f.submit class: 'btn btn-primary'

View file

@ -0,0 +1,3 @@
$('#modalContainer').html('#{j(render("custom_csv_form"))}');
$('#modalContainer').modal();
$('#modalContainer').submit(function() {$('#modalContainer').modal('hide');});

View file

@ -1463,6 +1463,9 @@ de:
units_ordered: Bestellte Einheiten units_ordered: Bestellte Einheiten
create: create:
notice: Die Bestellung wurde erstellt. notice: Die Bestellung wurde erstellt.
custom_csv:
description: Wähle die Attribute und deren Reihenfolge für die zu erzeugende CSV Datei
column: Spalte
edit: edit:
title: 'Bestellung bearbeiten: %{name}' title: 'Bestellung bearbeiten: %{name}'
edit_amount: edit_amount:

View file

@ -1473,6 +1473,9 @@ en:
units_ordered: Units ordered units_ordered: Units ordered
create: create:
notice: The order was created. notice: The order was created.
custom_csv:
description: Please choose the order as well as the attributes for the csv file
column: column
edit: edit:
title: 'Edit order: %{name}' title: 'Edit order: %{name}'
edit_amount: edit_amount:
@ -1626,6 +1629,7 @@ en:
who_ordered: Who ordered? who_ordered: Who ordered?
order_download_button: order_download_button:
article_pdf: Article PDF article_pdf: Article PDF
custom_csv: Custom CSV
download_file: Download file download_file: Download file
fax_csv: Fax CSV fax_csv: Fax CSV
fax_pdf: Fax PDF fax_pdf: Fax PDF

View file

@ -1259,6 +1259,9 @@ es:
units_ordered: Unidades pedidas units_ordered: Unidades pedidas
create: create:
notice: Se ha creado el pedido notice: Se ha creado el pedido
custom_csv:
description: Por favor elija el orden de los atributos así como los atributos para el archivo csv
column: columna
edit: edit:
title: 'Edita pedido: %{name}' title: 'Edita pedido: %{name}'
edit_amount: edit_amount:

View file

@ -1010,6 +1010,9 @@ fr:
units_ordered: Unités commandées units_ordered: Unités commandées
create: create:
notice: La commande a bien été définie. notice: La commande a bien été définie.
custom_csv:
description: Veuillez choisir l'ordre des attributs ainsi que les attributs pour le fichier csv
column: colonne
edit: edit:
title: 'Modifier la commande: %{name}' title: 'Modifier la commande: %{name}'
edit_amount: edit_amount:

View file

@ -1438,6 +1438,9 @@ nl:
units_ordered: Bestelde eenheden units_ordered: Bestelde eenheden
create: create:
notice: De bestelling is aangemaakt. notice: De bestelling is aangemaakt.
custom_csv:
description: Kies de volgorde van de attributen en de attributen voor het csv-bestand
column: kolom
edit: edit:
title: 'Bestelling aanpassen: %{name}' title: 'Bestelling aanpassen: %{name}'
edit_amount: edit_amount: