foodsoft/app/views/ordering/_finishedOrders.haml

30 lines
1.4 KiB
Plaintext
Raw Normal View History

2009-01-06 11:49:19 +01:00
%table.list
%thead
%tr
%th=_ 'Name'
%th=_ 'Supplier'
%th=_ 'End'
%th=_ 'Sum'
%tbody
- @finishedOrders.each do |order|
- if order.is_a?(GroupOrder) or order.is_a?(GroupOrderResult)
%tr{:class=> cycle('even', 'odd', :name => 'bookedOrders')}
%td= link_to order.order.name, :action => 'my_order_result', :id => order.order
%td=h order.order.supplier ? order.order.supplier.name : _("nonexistent")
%td= format_time(order.order.ends)
%td{:class => "currency"}= number_to_currency(order.price)
- else
// check if the OrderGroup has ordered
- if groupOrder = order.group_order(@orderGroup)
%tr{:class=> cycle('even', 'odd', :name => 'finishedOrders')}
%td= link_to order.name, :action => 'my_order_result', :id => order
%td=h order.supplier ? order.supplier.name : _("nonexistent")
%td= format_time(order.ends)
%td{:class => "currency"}= number_to_currency(groupOrder.price)
- else
%tr{:class=> cycle('even', 'odd', :name => 'finishedOrders'), :style => "color:grey"}
%td= link_to truncate(order.name), {:action => "my_order_result", :id => order}, :style => "color:grey"
%td= order.supplier ? order.supplier.name : _("nonexistent")
%td= format_time(order.ends)
%td{:class => "currency"} --