mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-01 06:41:41 +00:00
Adding 'Cancel Order' button to order confimation interface
This commit is contained in:
@@ -290,7 +290,7 @@ Spree::Order.class_eval do
|
||||
end
|
||||
|
||||
def editable?
|
||||
distributor.andand.allow_order_changes? && order_cycle.andand.open?
|
||||
complete? && distributor.andand.allow_order_changes? && order_cycle.andand.open?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
%i.ofn-i_008-caret-left
|
||||
= t(:back_to_store)
|
||||
- if order.editable?
|
||||
.columns.show-for-medium-up.medium-6
|
||||
-# .columns.small-12.medium-3
|
||||
-# = link_to "#", method: :delete, :class => "button secondary expand" do
|
||||
-# %i.ofn-i_009-close
|
||||
-# =t(:cancel_order)
|
||||
.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
|
||||
%i.ofn-i_009-close
|
||||
= t(:cancel_order)
|
||||
.columns.small-12.medium-3
|
||||
= button_tag :class => 'button primary radius expand', :id => 'update-button' do
|
||||
%i.ofn-i_051-check-big
|
||||
|
||||
@@ -10,8 +10,15 @@
|
||||
.row
|
||||
.columns.large-12.text-center
|
||||
%h2
|
||||
= t :orders_show_number
|
||||
= " #" + @order.number
|
||||
= t(:orders_show_order_number, number: @order.number)
|
||||
- if @order.canceled?
|
||||
%span.brick
|
||||
= t(:orders_show_cancelled)
|
||||
%i.ofn-i_009-close
|
||||
- elsif @order.complete?
|
||||
%span.turquoise
|
||||
= t(:orders_show_confirmed)
|
||||
%i.ofn-i_051-check-big
|
||||
|
||||
#order{"data-hook" => ""}
|
||||
- if params.has_key? :checkout_complete
|
||||
|
||||
Reference in New Issue
Block a user