Files
growstuff/app/views/admin/orders/search.html.haml
Cjay Billones bb88041fef [Refactoring] Replace .count and .length with .size for collections
Improved program efficiency (in querying in particular) by replacing .count and .length with .size for collections.

Fix error in refactoring

Reverted some .size into .count
2015-06-25 12:09:03 +08:00

40 lines
923 B
Plaintext

-content_for :title, 'Search Orders'
=render "admin/orders/searchform"
- unless @orders.empty?
%h2
Found
= pluralize(@orders.size, "result")
%table.table.table-striped
%tr
%th Member
%th Order number
%th Date completed
%th Referral code
%th Items
%th
- @orders.each do |order|
%tr
%td= link_to order.member.login_name, order.member
%td= order.id
%td
- if order.completed_at
= order.completed_at.to_s
- else
In progress
%td
= order.referral_code
%td
- if order.order_items.size > 0
- order.order_items.each do |o|
= o.quantity
x
= o.product.name
@
= price_with_currency(o.price)
%br/
%td= link_to 'Details', order, :class => 'btn btn-default btn-xs'