Files
openfoodnetwork/app/views/checkout/edit.html.haml
Gaetan Craig-Riou 8db2445203 Add comment to make sure both out of stock modal get updated.
There is no easy way to share template between AngularJS and Rails. The
modal in `edit.html.haml` is a copy of app/assets/javascripts/templates/out_of_stock.html.haml,
so we need to update both if either of them is updated.
2025-02-04 15:42:05 +11:00

54 lines
1.9 KiB
Plaintext

- content_for(:title) do
= checkout_page_title
.darkswarm.footer-pad{"data-turbo": "true"}
- content_for :order_cycle_form do
%closing
= t :checkout_now
%p
= t :checkout_order_ready
%strong
= pickup_time current_order_cycle
- content_for :ordercycle_sidebar do
.show-for-large-up.large-4.columns
= render partial: "shopping_shared/order_cycles"
= render partial: "shopping_shared/header"
.sub-header.show-for-medium-down
= render partial: "shopping_shared/order_cycles"
%div{ "data-controller": "guest-checkout", "data-guest-checkout-distributor-value": @order.distributor.id }
- if @any_out_of_stock
= render ModalComponent.new(id: "out-of-stock-items", modal_class: "medium" ,instant: true, close_button: false) do
- # please update app/assets/javascripts/templates/out_of_stock.html.haml if updating the modal html
%a.close-reveal-modal{"data-action": "click->modal#close" }
%i.ofn-i_009-close
%h3
= t("js.out_of_stock.reduced_stock_available")
%p
= t("js.out_of_stock.out_of_stock_text")
- @updated_variants.each do |variant|
- if variant.on_hand == 0
%p
%em
= "#{variant.name_to_display} - #{variant.unit_to_display}"
%span
= t("js.out_of_stock.now_out_of_stock")
- if variant.on_hand > 0
%p
%em
= "#{variant.name_to_display} - #{variant.unit_to_display}"
%span
= t("js.out_of_stock.only_n_remainging", num: variant.on_hand)
%div{ style: "display: #{spree_current_user ? 'block' : 'none'}", "data-guest-checkout-target": "checkout" }
= render partial: "checkout"
- unless spree_current_user
%div{ style: "display: block", "data-guest-checkout-target": "guest" }
= render partial: "guest"
= render partial: "shared/footer"