foodsoft/app/views/ordering/_bookedOrders.haml

31 lines
1.5 KiB
Text
Raw Normal View History

2009-01-06 11:49:19 +01:00
- if controller.action_name == 'myOrders'
= pagination_links_remote @bookedOrders, 10, {:show_all => params[:show_all]}
%table.list
%thead
%tr
%th=_ 'Name'
%th=_ 'Supplier'
%th=_ 'End'
%th=_ 'Sum'
%tbody
- @bookedOrders.each do |order|
- if order.is_a?(GroupOrder) || 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 => 'bookedOrders')}
%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 => 'bookedOrders'), :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"} --