2013-02-08 01:52:20 +01:00
|
|
|
- title t('.title')
|
2012-10-15 21:19:17 +02:00
|
|
|
|
2012-11-12 13:13:01 +01:00
|
|
|
- content_for :actionbar do
|
|
|
|
.btn-group
|
2012-10-30 00:20:47 +01:00
|
|
|
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn btn-primary dropdown-toggle' do
|
2013-02-08 01:52:20 +01:00
|
|
|
= t '.new_order'
|
2012-10-30 00:20:47 +01:00
|
|
|
%span.caret
|
|
|
|
%ul.dropdown-menu
|
2013-03-16 17:53:24 +01:00
|
|
|
- Supplier.undeleted.order('suppliers.name ASC').each do |supplier|
|
2012-10-30 00:20:47 +01:00
|
|
|
%li= link_to supplier.name, new_order_path(supplier_id: supplier.id), tabindex: -1
|
|
|
|
|
2012-11-12 13:13:01 +01:00
|
|
|
.well
|
2013-12-18 19:21:39 +01:00
|
|
|
- if not @open_orders.empty?
|
|
|
|
%h2= t '.open_orders'
|
|
|
|
- elsif not @orders_in_progress.empty?
|
|
|
|
%h2= t '.orders_in_progress'
|
|
|
|
- else
|
|
|
|
= t '.no_open_orders'
|
|
|
|
- unless @open_orders.empty? and @orders_in_progress.empty?
|
2012-10-15 21:19:17 +02:00
|
|
|
%table.table.table-striped
|
|
|
|
%thead
|
|
|
|
%tr
|
2013-11-23 12:05:29 +01:00
|
|
|
%th= heading_helper Order, :name
|
|
|
|
%th= heading_helper Order, :ends
|
|
|
|
%th= heading_helper Order, :note
|
2012-10-15 21:19:17 +02:00
|
|
|
%th{colspan: "2"}
|
|
|
|
%tbody
|
2013-12-18 19:21:39 +01:00
|
|
|
- unless @open_orders.empty?
|
|
|
|
- for order in @open_orders
|
|
|
|
- tr_class = " active" if order.expired?
|
|
|
|
%tr{class: tr_class}
|
|
|
|
%td= order.name
|
|
|
|
%td= format_time(order.ends) unless order.ends.nil?
|
|
|
|
%td= truncate(order.note)
|
|
|
|
%td= link_to t('.action_end'), finish_order_path(order),
|
|
|
|
confirm: t('.confirm_end', order: order.name), method: :post,
|
|
|
|
class: 'btn btn-small btn-success'
|
2012-10-15 21:19:17 +02:00
|
|
|
|
2013-12-18 19:21:39 +01:00
|
|
|
%td
|
|
|
|
= link_to t('ui.edit'), edit_order_path(order), class: 'btn btn-small'
|
|
|
|
= link_to t('ui.show'), order, class: 'btn btn-small'
|
|
|
|
= link_to t('ui.delete'), order, confirm: t('.confirm_delete'), method: :delete,
|
|
|
|
class: 'btn btn-small btn-danger'
|
|
|
|
|
|
|
|
- unless @orders_in_progress.empty?
|
|
|
|
- unless @open_orders.empty?
|
|
|
|
%tr
|
|
|
|
%td{colspan: 6}
|
|
|
|
%h2= t '.orders_in_progress'
|
|
|
|
- for order in @orders_in_progress
|
|
|
|
%tr
|
|
|
|
%td= order.name
|
|
|
|
%td= format_time(order.ends)
|
|
|
|
%td= truncate(order.note)
|
|
|
|
%td
|
2013-12-21 17:36:25 +01:00
|
|
|
- unless order.stockit?
|
|
|
|
-# TODO btn-success class only if not received before
|
|
|
|
= link_to t('.action_receive'), receive_order_path(order), class: 'btn btn-small btn-success'
|
2013-12-18 19:21:39 +01:00
|
|
|
|
|
|
|
%td
|
2013-12-18 22:22:34 +01:00
|
|
|
= link_to t('ui.edit'), '#', class: 'btn btn-small disabled', tabindex: -1
|
2013-12-18 19:21:39 +01:00
|
|
|
= link_to t('ui.show'), order, class: 'btn btn-small'
|
|
|
|
= link_to t('ui.delete'), order, confirm: t('.confirm_delete'), method: :delete,
|
|
|
|
class: 'btn btn-small btn-danger'
|
|
|
|
- else
|
|
|
|
%tr
|
|
|
|
%td{colspan: 6}= t '.no_orders_in_progress'
|
2012-10-15 21:19:17 +02:00
|
|
|
|
2013-12-18 21:58:15 +01:00
|
|
|
%h2= t '.closed_orders'
|
2012-10-15 21:19:17 +02:00
|
|
|
#orders_table
|
2013-02-08 01:52:20 +01:00
|
|
|
= render partial: 'orders'
|