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

71 lines
2.7 KiB
Text
Raw Permalink Normal View History

- title t('.title')
- 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
= t '.new_order'
2012-10-30 00:20:47 +01:00
%span.caret
%ul.dropdown-menu
2015-02-18 23:46:50 +01:00
- for supplier in @suppliers
2012-10-30 00:20:47 +01:00
%li= link_to supplier.name, new_order_path(supplier_id: supplier.id), tabindex: -1
.well
- if not @open_orders.empty?
2014-01-13 23:21:03 +01:00
%h2= t '.orders_open'
- elsif not @finished_orders.empty?
%h2= t '.orders_finished'
- else
2014-01-13 23:21:03 +01:00
= t '.no_open_or_finished_orders'
- unless @open_orders.empty? and @finished_orders.empty?
%table.table.table-striped
%thead
%tr
2013-11-23 12:05:29 +01:00
%th= heading_helper Order, :name
%th= heading_helper Order, :pickup
2013-11-23 12:05:29 +01:00
%th= heading_helper Order, :ends
%th= heading_helper Order, :note
%th{colspan: "2"}
%tbody
- unless @open_orders.empty?
- for order in @open_orders
- tr_class = " active" if order.expired?
%tr{class: tr_class}
%td= order.name
%td= format_date(order.pickup) unless order.pickup.nil?
%td= format_time(order.ends) unless order.ends.nil?
2023-03-29 15:15:59 +02:00
%td= truncate(order.note, length: 25, tooltip: true)
%td= link_to t('.action_end'), finish_order_path(order),
data: {confirm: t('.confirm_end', order: order.name)}, method: :post,
class: 'btn btn-small btn-success'
%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, data: {confirm: t('.confirm_delete')}, method: :delete,
class: 'btn btn-small btn-danger'
2014-01-13 23:21:03 +01:00
- unless @finished_orders.empty?
- unless @open_orders.empty?
%tr
%td{colspan: 6}
2014-01-13 23:21:03 +01:00
%h2= t '.orders_finished'
- for order in @finished_orders
%tr
%td= order.name
%td= format_date(order.pickup) unless order.pickup.nil?
%td= format_time(order.ends)
%td= truncate(order.note)
%td
2013-12-21 17:36:25 +01:00
- unless order.stockit?
= receive_button order, class: 'btn-small'
%td
= link_to t('ui.copy'), new_order_path(order_id: order), class: 'btn btn-small'
= link_to t('ui.show'), order, class: 'btn btn-small'
= link_to t('ui.delete'), order, data: {confirm: t('.confirm_delete')}, method: :delete,
class: 'btn btn-small btn-danger'
2014-01-13 23:21:03 +01:00
%h2= t '.orders_settled'
#orders_table
= render partial: 'orders'