mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-30 21:27:17 +00:00
Ask user to confirm cancellation of order
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
Darkswarm.directive "confirmLinkClick", ($window) ->
|
||||
restrict: 'A'
|
||||
scope:
|
||||
confirmMsg: '@confirmLinkClick'
|
||||
link: (scope, elem, attr) ->
|
||||
elem.bind 'click', (event) ->
|
||||
unless confirm(scope.confirmMsg)
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
@@ -14,7 +14,7 @@
|
||||
- if order.changes_allowed?
|
||||
.columns.show-for-medium-up.medium-3
|
||||
.columns.small-12.medium-3
|
||||
= link_to spree.cancel_order_path(@order), method: :put, :class => "button secondary expand" do
|
||||
= link_to spree.cancel_order_path(@order), method: :put, :class => "button secondary expand", "confirm-link-click" => t('orders_confirm_cancel') do
|
||||
%i.ofn-i_009-close
|
||||
= t(:cancel_order)
|
||||
.columns.small-12.medium-3
|
||||
|
||||
@@ -20,4 +20,4 @@
|
||||
%td.order6.text-right.show-for-large-up.brick
|
||||
%a{"ng-href" => "{{::order.path}}" }= t('.edit')
|
||||
%td.order7.text-right
|
||||
= link_to t('.cancel'), "", method: :put, "ng-href" => "{{::order.cancel_path}}"
|
||||
= link_to t('.cancel'), "", method: :put, "ng-href" => "{{::order.cancel_path}}", "confirm-link-click" => t('orders_confirm_cancel')
|
||||
|
||||
@@ -1066,6 +1066,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
other: "%{count} additional items already confirmed for this order cycle"
|
||||
orders_bought_edit_button: Edit confirmed items
|
||||
orders_bought_already_confirmed: "* already confirmed"
|
||||
orders_confirm_cancel: Are you sure you want to cancel this order?
|
||||
|
||||
products_cart_distributor_choice: "Distributor for your order:"
|
||||
products_cart_distributor_change: "Your distributor for this order will be changed to %{name} if you add this product to your cart."
|
||||
|
||||
Reference in New Issue
Block a user