tap/app/views/orders/new.html.haml
2016-02-04 00:23:12 +01:00

42 lines
1.5 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", data: { url: URI.join(root_url, "barcodes").to_s } do
%input.center-block{ type: :number, name: :id, autofocus: true }
= "- OR -"
%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
#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.hidden_field :product_id
%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'