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