tap/app/views/orders/new.html.haml

43 lines
1.5 KiB
Text
Raw Normal View History

.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
%input.center-block{ type: :number, name: :id, autofocus: true }
2015-09-20 21:21:18 +02:00
= "- OR -"
2016-02-04 00:23:12 +01:00
%p
%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
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
2015-10-28 22:07:48 +01:00
= ff.hidden_field :product_id
2015-09-20 21:21:18 +02:00
%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
2018-12-13 19:39:58 +01:00
= f.submit "Order!", class: "btn btn-primary form-control", data: { disable_with: "Please wait..." }
2015-09-20 21:21:18 +02:00
= render 'products_modal'