2015-10-07 14:52:44 +02:00
|
|
|
.row
|
|
|
|
.col-md-6.col-md-offset-1.barcode-wrapper
|
|
|
|
.center
|
2015-09-20 21:21:18 +02:00
|
|
|
%h1 Order for #{@user.name}
|
2015-10-27 17:11:12 +01:00
|
|
|
= form_tag nil, id: "from_barcode_form", data: { url: URI.join(root_url, "barcodes").to_s } do
|
2015-09-28 21:51:40 +02:00
|
|
|
%input.center-block{ type: :number, name: :id, autofocus: true }
|
2015-09-20 21:21:18 +02:00
|
|
|
= "- OR -"
|
|
|
|
%button.btn.btn-default.center-block{ data: { toggle: :modal, target: "#products_modal" } }
|
|
|
|
Select Product Without Barcode
|
2015-10-07 14:52:44 +02:00
|
|
|
.col-md-4.col-md-offset-1
|
|
|
|
= form_for [@user, @order] do |f|
|
|
|
|
= render 'errors', object: @order
|
2015-09-20 21:21:18 +02:00
|
|
|
#current_order
|
|
|
|
.div.center
|
|
|
|
= image_tag "logo.png"
|
|
|
|
%table
|
|
|
|
%tr.margin
|
|
|
|
= f.fields_for :order_items do |ff|
|
|
|
|
%tr.order_item_wrapper{ data: { product: ff.object.product.id, price: ff.object.product.price_cents } }
|
|
|
|
%td
|
|
|
|
= ff.number_field :count
|
|
|
|
= ff.fields_for :product do |fff|
|
|
|
|
/ Needed for haml
|
|
|
|
%td
|
|
|
|
x
|
|
|
|
%td
|
|
|
|
%span= ff.object.product.name
|
|
|
|
%td.euro
|
|
|
|
= euro_from_cents(ff.object.product.price_cents * ff.object.count)
|
|
|
|
%tr#empty
|
|
|
|
%td
|
|
|
|
%td
|
|
|
|
%em Empty Order.
|
|
|
|
%tr.margin
|
|
|
|
%tr
|
|
|
|
%td
|
|
|
|
%td
|
|
|
|
%td.text-right
|
|
|
|
Total:
|
|
|
|
%td.total_price.euro
|
|
|
|
= f.submit "Order!", class: "btn btn-primary form-control"
|
|
|
|
= render 'products_modal'
|