foodsoft/app/views/shared/_open_orders.html.haml

34 lines
1 KiB
Text
Raw Normal View History

%section
2013-02-08 19:16:06 +01:00
%h2= t '.title'
- if ordergroup.not_enough_apples?
2013-02-08 19:16:06 +01:00
.alert
2013-10-17 16:35:50 +02:00
= t '.not_enough_apples'
- unless Order.open.empty?
%table.table.table-striped
%thead
%tr
%th= heading_helper Order, :name
%th= heading_helper Order, :ends
2013-02-08 19:16:06 +01:00
%th= t '.who_ordered'
%th= heading_helper GroupOrder, :price
%tbody
- total = 0
- Order.open.each do |order|
%tr
%td= link_to_ordering(order)
%td= format_time(order.ends) unless order.ends.nil?
2011-06-13 15:26:06 +02:00
- if group_order = order.group_order(ordergroup)
- total += group_order.price
2013-09-20 22:40:13 +02:00
%td= "#{show_user group_order.updated_by} (#{format_time(group_order.updated_on)})"
%td.numeric= number_to_currency(group_order.price)
- else
2011-06-13 15:26:06 +02:00
%td{:colspan => 2}
- if total > 0
%tfooter
%tr
%th(colspan="2")
2013-02-08 19:16:06 +01:00
%th= t('.total_sum') + ':'
%th.numeric= number_to_currency(total)
- else
2013-02-08 19:16:06 +01:00
%i= t '.no_open_orders'