mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-04 22:16:08 +00:00
Merge pull request #2751 from luisramos0/2-0-order-details
[Spree Upgrade] Refactored spree/order_details, extracted delivery and pickup details into separate partials
This commit is contained in:
@@ -29,60 +29,10 @@
|
||||
= order.bill_address.phone
|
||||
|
||||
.columns.large-6
|
||||
- if order.shipping_method.andand.delivery?
|
||||
// Delivery option
|
||||
.order-summary.text-small
|
||||
%strong= order.shipping_method.name
|
||||
.pad
|
||||
.text-big
|
||||
= t :order_delivery_time
|
||||
%strong #{order.order_cycle.pickup_time_for(order.distributor)}
|
||||
%p.text-small.text-skinny.pre-line
|
||||
%em= order.shipping_method.description.andand.html_safe || ""
|
||||
.order-summary.text-small
|
||||
%strong
|
||||
= t :order_delivery_address
|
||||
.pad
|
||||
%p.text-small
|
||||
= order.ship_address.firstname + " " + order.ship_address.lastname
|
||||
%br
|
||||
= order.ship_address.full_address
|
||||
%br
|
||||
= order.ship_address.phone
|
||||
- if order.special_instructions.present?
|
||||
%br
|
||||
%p.light.small
|
||||
%strong
|
||||
= t :order_special_instructions
|
||||
%br
|
||||
= order.special_instructions
|
||||
- if order.shipping_method.andand.require_ship_address
|
||||
= render 'spree/shared/shipment_delivery_details', order: order
|
||||
- else
|
||||
// Collection option
|
||||
.order-summary.text-small
|
||||
%strong= order.shipping_method.name
|
||||
.pad
|
||||
.text-big
|
||||
= t :order_pickup_time
|
||||
%strong #{order.order_cycle.pickup_time_for(order.distributor)}
|
||||
%p.text-small.text-skinny.pre-line
|
||||
%em= order.shipping_method.description.andand.html_safe || ""
|
||||
|
||||
- if order.order_cycle.pickup_instructions_for(order.distributor).present?
|
||||
%br
|
||||
%p.text-small
|
||||
%strong
|
||||
= t :order_pickup_instructions
|
||||
%br
|
||||
#{order.order_cycle.pickup_instructions_for(order.distributor)}
|
||||
|
||||
- if order.special_instructions.present?
|
||||
%br
|
||||
%p.light.small
|
||||
%strong
|
||||
= t :order_special_instructions
|
||||
%br
|
||||
= order.special_instructions
|
||||
|
||||
= render 'spree/shared/shipment_pickup_details', order: order
|
||||
%br
|
||||
.row
|
||||
.columns.large-12
|
||||
|
||||
25
app/views/spree/shared/_shipment_delivery_details.html.haml
Normal file
25
app/views/spree/shared/_shipment_delivery_details.html.haml
Normal file
@@ -0,0 +1,25 @@
|
||||
.order-summary.text-small
|
||||
%strong= order.shipping_method.name
|
||||
.pad
|
||||
.text-big
|
||||
= t :order_delivery_time
|
||||
%strong #{order.order_cycle.pickup_time_for(order.distributor)}
|
||||
%p.text-small.text-skinny.pre-line
|
||||
%em= order.shipping_method.description.andand.html_safe || ""
|
||||
.order-summary.text-small
|
||||
%strong
|
||||
= t :order_delivery_address
|
||||
.pad
|
||||
%p.text-small
|
||||
= order.ship_address.firstname + " " + order.ship_address.lastname
|
||||
%br
|
||||
= order.ship_address.full_address
|
||||
%br
|
||||
= order.ship_address.phone
|
||||
- if order.special_instructions.present?
|
||||
%br
|
||||
%p.light.small
|
||||
%strong
|
||||
= t :order_special_instructions
|
||||
%br
|
||||
= order.special_instructions
|
||||
25
app/views/spree/shared/_shipment_pickup_details.html.haml
Normal file
25
app/views/spree/shared/_shipment_pickup_details.html.haml
Normal file
@@ -0,0 +1,25 @@
|
||||
.order-summary.text-small
|
||||
%strong= order.shipping_method.name
|
||||
.pad
|
||||
.text-big
|
||||
= t :order_pickup_time
|
||||
%strong #{order.order_cycle.pickup_time_for(order.distributor)}
|
||||
%p.text-small.text-skinny.pre-line
|
||||
%em= order.shipping_method.description.andand.html_safe || ""
|
||||
|
||||
- if order.order_cycle.pickup_instructions_for(order.distributor).present?
|
||||
%br
|
||||
%p.text-small
|
||||
%strong
|
||||
= t :order_pickup_instructions
|
||||
%br
|
||||
#{order.order_cycle.pickup_instructions_for(order.distributor)}
|
||||
|
||||
- if order.special_instructions.present?
|
||||
%br
|
||||
%p.light.small
|
||||
%strong
|
||||
= t :order_special_instructions
|
||||
%br
|
||||
= order.special_instructions
|
||||
|
||||
@@ -21,6 +21,11 @@ feature "Order Management", js: true do
|
||||
quick_login_as user
|
||||
end
|
||||
|
||||
it 'shows the name of the shipping method' do
|
||||
visit spree.order_path(order)
|
||||
expect(find('#order')).to have_content(shipping_method.name)
|
||||
end
|
||||
|
||||
context "when the distributor doesn't allow changes to be made to orders" do
|
||||
before do
|
||||
order.distributor.update_attributes(allow_order_changes: false)
|
||||
|
||||
Reference in New Issue
Block a user