Make the download button of orders reusable
This commit is contained in:
parent
3e156bbbf3
commit
bd49a64cd7
7 changed files with 58 additions and 58 deletions
|
@ -65,19 +65,7 @@
|
||||||
= update_articles_link @order, t('.sort_article'), :articles, class: 'btn'
|
= update_articles_link @order, t('.sort_article'), :articles, class: 'btn'
|
||||||
|
|
||||||
- unless @order.open?
|
- unless @order.open?
|
||||||
.btn-group
|
= render 'shared/order_download_button', order: @order, klass: ''
|
||||||
= link_to '#', class: 'btn dropdown-toggle', data: {toggle: 'dropdown'} do
|
|
||||||
= t '.download.title'
|
|
||||||
%span.caret
|
|
||||||
%ul.dropdown-menu
|
|
||||||
%li= order_pdf(@order, :groups, t('.download.group_pdf'))
|
|
||||||
%li= order_pdf(@order, :articles, t('.download.article_pdf'))
|
|
||||||
%li= order_pdf(@order, :matrix, t('.download.matrix_pdf'))
|
|
||||||
%li= order_pdf(@order, :fax, t('.download.fax_pdf'))
|
|
||||||
- unless @order.stockit?
|
|
||||||
%li= link_to t('.download.fax_txt'), order_path(@order, format: :txt), {title: t('.download.download_file')}
|
|
||||||
%li= link_to t('.download.fax_csv'), order_path(@order, format: :csv), {title: t('.download.download_file')}
|
|
||||||
|
|
||||||
- if @order.open?
|
- if @order.open?
|
||||||
= link_to t('.action_end'), finish_order_path(@order), method: :post, class: 'btn btn-success',
|
= link_to t('.action_end'), finish_order_path(@order), method: :post, class: 'btn btn-success',
|
||||||
data: {confirm: t('.confirm_end', order: @order.name)}
|
data: {confirm: t('.confirm_end', order: @order.name)}
|
||||||
|
|
12
app/views/shared/_order_download_button.html.haml
Normal file
12
app/views/shared/_order_download_button.html.haml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
.btn-group
|
||||||
|
= link_to '#', class: "btn #{klass} dropdown-toggle", data: {toggle: 'dropdown'} do
|
||||||
|
= t '.title'
|
||||||
|
%span.caret
|
||||||
|
%ul.dropdown-menu
|
||||||
|
%li= order_pdf(order, :groups, t('.group_pdf'))
|
||||||
|
%li= order_pdf(order, :articles, t('.article_pdf'))
|
||||||
|
%li= order_pdf(order, :matrix, t('.matrix_pdf'))
|
||||||
|
%li= order_pdf(order, :fax, t('.fax_pdf'))
|
||||||
|
- unless order.stockit?
|
||||||
|
%li= link_to t('.fax_txt'), order_path(order, format: :txt), {title: t('.download_file')}
|
||||||
|
%li= link_to t('.fax_csv'), order_path(order, format: :csv), {title: t('.download_file')}
|
|
@ -1563,15 +1563,6 @@ de:
|
||||||
starts: läuft von %{starts}
|
starts: läuft von %{starts}
|
||||||
starts_ends: läuft von %{starts} bis %{ends}
|
starts_ends: läuft von %{starts} bis %{ends}
|
||||||
description2: "%{ordergroups} haben %{article_count} Artikel mit einem Gesamtwert von %{net_sum} / %{gross_sum} (netto / brutto) bestellt."
|
description2: "%{ordergroups} haben %{article_count} Artikel mit einem Gesamtwert von %{net_sum} / %{gross_sum} (netto / brutto) bestellt."
|
||||||
download:
|
|
||||||
article_pdf: Artikel PDF
|
|
||||||
download_file: Download file
|
|
||||||
fax_csv: Fax CSV
|
|
||||||
fax_pdf: Fax PDF
|
|
||||||
fax_txt: Fax Text
|
|
||||||
group_pdf: Gruppen PDF
|
|
||||||
matrix_pdf: Matrix PDF
|
|
||||||
title: Download
|
|
||||||
group_orders: 'Gruppenbestellungen:'
|
group_orders: 'Gruppenbestellungen:'
|
||||||
search_placeholder:
|
search_placeholder:
|
||||||
articles: Suche nach Artikeln ...
|
articles: Suche nach Artikeln ...
|
||||||
|
@ -1717,6 +1708,15 @@ de:
|
||||||
title: Laufende Bestellungen
|
title: Laufende Bestellungen
|
||||||
total_sum: Gesamtsumme
|
total_sum: Gesamtsumme
|
||||||
who_ordered: Wer hat bestellt?
|
who_ordered: Wer hat bestellt?
|
||||||
|
order_download_button:
|
||||||
|
article_pdf: Artikel PDF
|
||||||
|
download_file: Download file
|
||||||
|
fax_csv: Fax CSV
|
||||||
|
fax_pdf: Fax PDF
|
||||||
|
fax_txt: Fax Text
|
||||||
|
group_pdf: Gruppen PDF
|
||||||
|
matrix_pdf: Matrix PDF
|
||||||
|
title: Download
|
||||||
task_list:
|
task_list:
|
||||||
accept_task: Aufgabe übernehmen
|
accept_task: Aufgabe übernehmen
|
||||||
done: Erledigt
|
done: Erledigt
|
||||||
|
|
|
@ -1573,15 +1573,6 @@ en:
|
||||||
starts: open from %{starts}
|
starts: open from %{starts}
|
||||||
starts_ends: open from %{starts} until %{ends}
|
starts_ends: open from %{starts} until %{ends}
|
||||||
description2: "%{ordergroups} ordered %{article_count} articles, with a total value of %{net_sum} / %{gross_sum} (net / gross)."
|
description2: "%{ordergroups} ordered %{article_count} articles, with a total value of %{net_sum} / %{gross_sum} (net / gross)."
|
||||||
download:
|
|
||||||
article_pdf: Article PDF
|
|
||||||
download_file: Download file
|
|
||||||
fax_csv: Fax CSV
|
|
||||||
fax_pdf: Fax PDF
|
|
||||||
fax_txt: Fax text
|
|
||||||
group_pdf: Group PDF
|
|
||||||
matrix_pdf: Matrix PDF
|
|
||||||
title: Download
|
|
||||||
group_orders: 'Group orders:'
|
group_orders: 'Group orders:'
|
||||||
search_placeholder:
|
search_placeholder:
|
||||||
articles: Search for articles...
|
articles: Search for articles...
|
||||||
|
@ -1727,6 +1718,15 @@ en:
|
||||||
title: Current orders
|
title: Current orders
|
||||||
total_sum: Total sum
|
total_sum: Total sum
|
||||||
who_ordered: Who ordered?
|
who_ordered: Who ordered?
|
||||||
|
order_download_button:
|
||||||
|
article_pdf: Article PDF
|
||||||
|
download_file: Download file
|
||||||
|
fax_csv: Fax CSV
|
||||||
|
fax_pdf: Fax PDF
|
||||||
|
fax_txt: Fax text
|
||||||
|
group_pdf: Group PDF
|
||||||
|
matrix_pdf: Matrix PDF
|
||||||
|
title: Download
|
||||||
task_list:
|
task_list:
|
||||||
accept_task: Accept task
|
accept_task: Accept task
|
||||||
done: Done
|
done: Done
|
||||||
|
|
|
@ -1539,15 +1539,6 @@ es:
|
||||||
starts: abierto desde %{starts}
|
starts: abierto desde %{starts}
|
||||||
starts_ends: abierto desde %{starts} hasta %{ends}
|
starts_ends: abierto desde %{starts} hasta %{ends}
|
||||||
description2: "%{ordergroups} ha pedido %{article_count} artículos, con un valor total de %{net_sum} / %{gross_sum} (neto / bruto)."
|
description2: "%{ordergroups} ha pedido %{article_count} artículos, con un valor total de %{net_sum} / %{gross_sum} (neto / bruto)."
|
||||||
download:
|
|
||||||
article_pdf: Artículos PDF
|
|
||||||
download_file: Descargar archivo
|
|
||||||
fax_csv: Fax CSV
|
|
||||||
fax_pdf: Fax PDF
|
|
||||||
fax_txt: Fax text
|
|
||||||
group_pdf: Group PDF
|
|
||||||
matrix_pdf: Matrix PDF
|
|
||||||
title: Descargar
|
|
||||||
group_orders: 'Pedidos del grupo:'
|
group_orders: 'Pedidos del grupo:'
|
||||||
search_placeholder:
|
search_placeholder:
|
||||||
articles: Busca artículos...
|
articles: Busca artículos...
|
||||||
|
@ -1695,6 +1686,15 @@ es:
|
||||||
title: Pedidos activos
|
title: Pedidos activos
|
||||||
total_sum: Suma total
|
total_sum: Suma total
|
||||||
who_ordered: "¿Quién ha pedido?"
|
who_ordered: "¿Quién ha pedido?"
|
||||||
|
order_download_button:
|
||||||
|
article_pdf: Artículos PDF
|
||||||
|
download_file: Descargar archivo
|
||||||
|
fax_csv: Fax CSV
|
||||||
|
fax_pdf: Fax PDF
|
||||||
|
fax_txt: Fax text
|
||||||
|
group_pdf: Group PDF
|
||||||
|
matrix_pdf: Matrix PDF
|
||||||
|
title: Descargar
|
||||||
task_list:
|
task_list:
|
||||||
accept_task: Acepta la tarea
|
accept_task: Acepta la tarea
|
||||||
done: Hecho
|
done: Hecho
|
||||||
|
|
|
@ -1536,15 +1536,6 @@ fr:
|
||||||
starts: ouverte du %{starts}
|
starts: ouverte du %{starts}
|
||||||
starts_ends: ouverte du %{starts} au %{ends}
|
starts_ends: ouverte du %{starts} au %{ends}
|
||||||
description2: "%{ordergroups} ont commandé %{article_count} articles, pour un montant total de %{net_sum} (net)/ %{gross_sum} (brut)"
|
description2: "%{ordergroups} ont commandé %{article_count} articles, pour un montant total de %{net_sum} (net)/ %{gross_sum} (brut)"
|
||||||
download:
|
|
||||||
article_pdf: Liste des articles en PDF
|
|
||||||
download_file: Télécharger
|
|
||||||
fax_csv: Fax CSV
|
|
||||||
fax_pdf: Fax au format PDF
|
|
||||||
fax_txt: Fax au format texte
|
|
||||||
group_pdf: Liste des cellules en PDF
|
|
||||||
matrix_pdf: Matrice de répartition en PDF
|
|
||||||
title: Télécharger
|
|
||||||
group_orders: 'Commandes des cellules:'
|
group_orders: 'Commandes des cellules:'
|
||||||
search_placeholder:
|
search_placeholder:
|
||||||
articles: Rechercher des articles...
|
articles: Rechercher des articles...
|
||||||
|
@ -1690,6 +1681,15 @@ fr:
|
||||||
title: Commandes en cours
|
title: Commandes en cours
|
||||||
total_sum: Total
|
total_sum: Total
|
||||||
who_ordered: Qui a commandé?
|
who_ordered: Qui a commandé?
|
||||||
|
order_download_button:
|
||||||
|
article_pdf: Liste des articles en PDF
|
||||||
|
download_file: Télécharger
|
||||||
|
fax_csv: Fax CSV
|
||||||
|
fax_pdf: Fax au format PDF
|
||||||
|
fax_txt: Fax au format texte
|
||||||
|
group_pdf: Liste des cellules en PDF
|
||||||
|
matrix_pdf: Matrice de répartition en PDF
|
||||||
|
title: Télécharger
|
||||||
task_list:
|
task_list:
|
||||||
accept_task: Te charger de ce boulot
|
accept_task: Te charger de ce boulot
|
||||||
done: Effectué
|
done: Effectué
|
||||||
|
|
|
@ -1540,15 +1540,6 @@ nl:
|
||||||
starts: open van %{starts}
|
starts: open van %{starts}
|
||||||
starts_ends: open van %{starts} tot %{ends}
|
starts_ends: open van %{starts} tot %{ends}
|
||||||
description2: "%{ordergroups} hebben %{article_count} artikelen besteld met een totale waarde van %{net_sum} / %{gross_sum} (netto / bruto)."
|
description2: "%{ordergroups} hebben %{article_count} artikelen besteld met een totale waarde van %{net_sum} / %{gross_sum} (netto / bruto)."
|
||||||
download:
|
|
||||||
article_pdf: Artikelen PDF
|
|
||||||
download_file: Bestand downloaden
|
|
||||||
fax_csv: Fax CSV
|
|
||||||
fax_pdf: Fax PDF
|
|
||||||
fax_txt: Fax text
|
|
||||||
group_pdf: Huishoudens PDF
|
|
||||||
matrix_pdf: Matrix PDF
|
|
||||||
title: Downloaden
|
|
||||||
group_orders: 'Ledenbestellingen:'
|
group_orders: 'Ledenbestellingen:'
|
||||||
search_placeholder:
|
search_placeholder:
|
||||||
articles: Artikelen zoeken...
|
articles: Artikelen zoeken...
|
||||||
|
@ -1694,6 +1685,15 @@ nl:
|
||||||
title: Lopende bestellingen
|
title: Lopende bestellingen
|
||||||
total_sum: Totaalsom
|
total_sum: Totaalsom
|
||||||
who_ordered: Wie heeft besteld?
|
who_ordered: Wie heeft besteld?
|
||||||
|
order_download_button:
|
||||||
|
article_pdf: Artikelen PDF
|
||||||
|
download_file: Bestand downloaden
|
||||||
|
fax_csv: Fax CSV
|
||||||
|
fax_pdf: Fax PDF
|
||||||
|
fax_txt: Fax text
|
||||||
|
group_pdf: Huishoudens PDF
|
||||||
|
matrix_pdf: Matrix PDF
|
||||||
|
title: Downloaden
|
||||||
task_list:
|
task_list:
|
||||||
accept_task: Taak accepteren
|
accept_task: Taak accepteren
|
||||||
done: Gedaan
|
done: Gedaan
|
||||||
|
|
Loading…
Reference in a new issue