Make the download button of orders reusable

This commit is contained in:
Patrick Gansterer 2017-11-06 09:31:06 +01:00
parent 3e156bbbf3
commit bd49a64cd7
7 changed files with 58 additions and 58 deletions

View file

@ -65,19 +65,7 @@
= update_articles_link @order, t('.sort_article'), :articles, class: 'btn'
- unless @order.open?
.btn-group
= 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')}
= render 'shared/order_download_button', order: @order, klass: ''
- if @order.open?
= link_to t('.action_end'), finish_order_path(@order), method: :post, class: 'btn btn-success',
data: {confirm: t('.confirm_end', order: @order.name)}

View 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')}

View file

@ -1563,15 +1563,6 @@ de:
starts: läuft von %{starts}
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."
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:'
search_placeholder:
articles: Suche nach Artikeln ...
@ -1717,6 +1708,15 @@ de:
title: Laufende Bestellungen
total_sum: Gesamtsumme
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:
accept_task: Aufgabe übernehmen
done: Erledigt

View file

@ -1573,15 +1573,6 @@ en:
starts: open from %{starts}
starts_ends: open from %{starts} until %{ends}
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:'
search_placeholder:
articles: Search for articles...
@ -1727,6 +1718,15 @@ en:
title: Current orders
total_sum: Total sum
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:
accept_task: Accept task
done: Done

View file

@ -1539,15 +1539,6 @@ es:
starts: abierto desde %{starts}
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)."
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:'
search_placeholder:
articles: Busca artículos...
@ -1695,6 +1686,15 @@ es:
title: Pedidos activos
total_sum: Suma total
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:
accept_task: Acepta la tarea
done: Hecho

View file

@ -1536,15 +1536,6 @@ fr:
starts: ouverte du %{starts}
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)"
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:'
search_placeholder:
articles: Rechercher des articles...
@ -1690,6 +1681,15 @@ fr:
title: Commandes en cours
total_sum: Total
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:
accept_task: Te charger de ce boulot
done: Effectué

View file

@ -1540,15 +1540,6 @@ nl:
starts: open van %{starts}
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)."
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:'
search_placeholder:
articles: Artikelen zoeken...
@ -1694,6 +1685,15 @@ nl:
title: Lopende bestellingen
total_sum: Totaalsom
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:
accept_task: Taak accepteren
done: Gedaan