foodsoft/app/views/orders/show.html.haml

63 lines
2.3 KiB
Text
Raw Normal View History

- title t('.title', name: @order.name)
2009-01-06 11:49:19 +01:00
- if @order.finished? and !@order.closed?
.alert.alert-warning
= t '.warn_not_closed'
2009-01-06 11:49:19 +01:00
// Order summary
.well
%dl.dl-horizontal
%dt= t '.supplier'
%dd= @order.name
- if @note.present?
%dt= t '.note'
%dd= @order.note
%dt= t '.created_by'
%dd= link_to_user_message_if_valid(@order.created_by)
%dt= t '.begin'
%dd= format_time(@order.starts)
%dt= t '.ending'
%dd= format_time(@order.ends)
%dt= t '.group_orders'
%dd #{@order.group_orders.count} (#{@order.group_orders.includes(:ordergroup).all.map {|g| g.ordergroup.name}.join(', ')})
%dt= t '.amounts'
%dd= "#{number_to_currency(@order.sum(:net))} / #{number_to_currency(@order.sum(:gross))}"
%dt= t '.articles_ordered'
%dd= @order.order_articles.ordered.count
2009-02-03 21:14:48 +01:00
.form-actions
2009-02-03 21:14:48 +01:00
- if @order.open?
= link_to t('ui.edit'), edit_order_path(@order), class: 'btn'
= link_to t('.action_end'), finish_order_path(@order), method: :post, class: 'btn btn-success',
2013-02-09 12:18:07 +01:00
confirm: t('.confirm_end', order: @order.name)
2009-02-03 21:14:48 +01:00
- unless @order.closed?
= link_to t('ui.delete'), @order, confirm: t('.confirm_delete'), method: :delete,
class: 'btn btn-danger'
- unless @order.open?
%ul.nav.nav-pills
%li= update_articles_link(@order, t('.articles'), :default)
%li= update_articles_link(@order, t('.sort_group'), :groups)
%li= update_articles_link(@order, t('.sort_article'), :articles)
%li= link_to t('.comments_link'), '#comments'
%li.dropdown
= link_to '#', class: 'dropdown-toggle', data: {toggle: 'dropdown'} do
= t '.download.title'
%b.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'))
%li= link_to t('.fax_txt'), {action: 'text_fax_template', id: @order }, {title: t('.download_file')}
%section#articles_table
= render 'articles', order: @order
2009-01-06 11:49:19 +01:00
%h2= t '.comments.title'
#comments
= render partial: 'shared/comments', locals: { comments: @order.comments }
#new_comment= render partial: 'order_comments/form', locals: { order_comment: @order.comments.build(user: current_user)}
= link_to_top