42 lines
1.4 KiB
Text
42 lines
1.4 KiB
Text
.row
|
|
.col-md-6.col-md-offset-1.barcode-wrapper
|
|
.center
|
|
%h1 Order for #{@user.name}
|
|
= form_tag nil, id: "from_barcode_form" do
|
|
%input.center-block{ type: :number, name: :id, autofocus: true }
|
|
= "- OR -"
|
|
%button.btn.btn-default.center-block{ data: { toggle: :modal, target: "#products_modal" } }
|
|
Select Product Without Barcode
|
|
.col-md-4.col-md-offset-1
|
|
= form_for [@user, @order] do |f|
|
|
= render 'errors', object: @order
|
|
#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'
|