Files
growstuff/app/views/orders/index.html.haml
2017-02-08 07:25:59 +13:00

45 lines
998 B
Plaintext

- content_for :title, "Your Account"
= render "shared/account_status"
%h2 Orders
- if current_member.orders.present?
%p
Your order history shows what you have bought via our
= succeed "." do
= link_to "shop", shop_path
%table.table.table-striped
%tr
%th Order number
%th Date completed
%th Items
%th
- @orders.each do |order|
%tr
%td= order.id
%td
- if order.completed_at
= order.completed_at.to_s
- else
In progress
%td
- unless order.order_items.empty?
- 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'
- else
%p
You have not made any orders. You can place an order via our
= succeed "." do
= link_to "shop", shop_path