mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-10 23:07:47 +00:00
49 lines
2.2 KiB
Plaintext
49 lines
2.2 KiB
Plaintext
%tr.line-item{class: "variant-#{variant.id}"}
|
|
|
|
/ removed image thumbnail on shopping cart & checkout to simplify
|
|
/ %td.cart-item-image{"data-hook" => "cart_item_image"}
|
|
/ - if variant.images.length == 0
|
|
/ = link_to small_image(variant.product), variant.product
|
|
/ - else
|
|
/ = link_to image_tag(variant.images.first.attachment.url(:small)), variant.product
|
|
|
|
%td.cart-item-description{'data-hook' => "cart_item_description"}
|
|
|
|
%div.item-thumb-image{"data-hook" => "cart_item_image"}
|
|
- if variant.images.length == 0
|
|
= link_to mini_image(variant.product), variant.product
|
|
- else
|
|
= link_to image_tag(variant.images.first.attachment.url(:mini)), variant.product
|
|
|
|
- if variant.product.name == variant.name_to_display
|
|
%h5
|
|
%span= variant.product.name
|
|
%span.text-small.text-skinny= " (" + variant.options_text + ")" unless variant.options_text.empty?
|
|
- else
|
|
%h5
|
|
%span= variant.product.name
|
|
%span= "- " + variant.name_to_display
|
|
%span.text-small.text-skinny= " (" + variant.options_text + ")" unless variant.options_text.empty?
|
|
|
|
- if @order.insufficient_stock_lines.include? line_item
|
|
%span.out-of-stock
|
|
= variant.in_stock? ? t(:insufficient_stock, :on_hand => variant.on_hand) : t(:out_of_stock)
|
|
%br/
|
|
|
|
%td.text-right.cart-item-price{"data-hook" => "cart_item_price"}
|
|
= line_item.single_display_amount_with_adjustments.to_html
|
|
-# Now in a template in app/assets/javascripts/templates !
|
|
-# %price-breakdown{"price-breakdown" => "_", variant: "variant",
|
|
-# "price-breakdown-append-to-body" => "true",
|
|
-# "price-breakdown-placement" => "left",
|
|
-# "price-breakdown-animation" => true}
|
|
%td.text-center.cart-item-quantity{"data-hook" => "cart_item_quantity"}
|
|
= item_form.number_field :quantity, :min => 0, :class => "line_item_quantity", :size => 5
|
|
%td.cart-item-total.text-right{"data-hook" => "cart_item_total"}
|
|
= line_item.display_amount_with_adjustments.to_html unless line_item.quantity.nil?
|
|
|
|
%td.cart-item-delete.text-center{"data-hook" => "cart_item_delete"}
|
|
{{ quantity }}
|
|
%a.delete{href: "#", id: "delete_#{dom_id(line_item)}"}
|
|
%i.delete.ofn-i_026-trash
|