From 91e88bd02842df82d45eb5f72f978f96ce7bb237 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 25 Mar 2020 10:08:48 +0100 Subject: [PATCH] Allow conditional use of order cycle sidebar We need to re-use the "shopping_shared/header" partial in multiple places, but we don't always want the (nested) order cycle sidebar inside it. --- app/views/checkout/edit.html.haml | 5 ++++- app/views/enterprises/shop.html.haml | 4 ++++ app/views/shopping_shared/_header.html.haml | 3 +-- app/views/spree/orders/edit.html.haml | 4 ++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/views/checkout/edit.html.haml b/app/views/checkout/edit.html.haml index 312b7b5a79..2f5d2afabe 100644 --- a/app/views/checkout/edit.html.haml +++ b/app/views/checkout/edit.html.haml @@ -7,7 +7,6 @@ .darkswarm.footer-pad - content_for :order_cycle_form do - %closing = t :checkout_now %p @@ -15,6 +14,10 @@ %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" %accordion{"close-others" => "false"} diff --git a/app/views/enterprises/shop.html.haml b/app/views/enterprises/shop.html.haml index e08625d0df..7f98960b33 100644 --- a/app/views/enterprises/shop.html.haml +++ b/app/views/enterprises/shop.html.haml @@ -38,6 +38,10 @@ - if oc_select_options.count > 1 %option{value: "", disabled: "", selected: ""}= t :shopping_oc_select + - content_for :ordercycle_sidebar do + .show-for-large-up.large-4.columns + = render partial: "shopping_shared/order_cycles" + = render partial: "shopping_shared/header" = render partial: "shopping_shared/tabs" diff --git a/app/views/shopping_shared/_header.html.haml b/app/views/shopping_shared/_header.html.haml index 03661a22ea..e718e9247c 100644 --- a/app/views/shopping_shared/_header.html.haml +++ b/app/views/shopping_shared/_header.html.haml @@ -10,5 +10,4 @@ = distributor.name %location= distributor.address.city - .show-for-large-up.large-4.columns - = render partial: "shopping_shared/order_cycles" + = yield :ordercycle_sidebar diff --git a/app/views/spree/orders/edit.html.haml b/app/views/spree/orders/edit.html.haml index 56f4e03ef8..e1ded2b7a8 100644 --- a/app/views/spree/orders/edit.html.haml +++ b/app/views/spree/orders/edit.html.haml @@ -16,6 +16,10 @@ - else = @order.distributor.next_collection_at + - content_for :ordercycle_sidebar do + .show-for-large-up.large-4.columns + = render partial: "shopping_shared/order_cycles" + = render partial: "shopping_shared/header" %fieldset.footer-pad