5eb8abf431
Reduces the number of SQL queries used on group_orders/index and group_orders/archive, but adds extra complexity to the code
19 lines
782 B
Text
19 lines
782 B
Text
%table.table.table-striped
|
|
%thead
|
|
%tr
|
|
%th= heading_helper Order, :name
|
|
%th= heading_helper Order, :pickup
|
|
%th= heading_helper Order, :ends
|
|
%th= heading_helper GroupOrder, :price
|
|
%tbody
|
|
- for order_hash in orders
|
|
- order = order_hash[:order]
|
|
- group_order = order_hash[:group_order]
|
|
- order_class = group_order ? "" : "color:grey"
|
|
%tr{:class=> cycle('even', 'odd', :name => 'orders'), :style => order_class}
|
|
%td= group_order.present? ? link_to(order.name, group_order_path(group_order)) : order.name
|
|
%td= format_date(order.pickup)
|
|
%td= format_time(order.ends)
|
|
%td.numeric= group_order ? number_to_currency(group_order.price) : "--"
|
|
- if pagination
|
|
= pagination_links_remote @closed_orders
|