diff --git a/app/helpers/shop_helper.rb b/app/helpers/shop_helper.rb index 2a855dbd9f..f2d397b654 100644 --- a/app/helpers/shop_helper.rb +++ b/app/helpers/shop_helper.rb @@ -36,7 +36,10 @@ module ShopHelper end def shopfront_closed_message? - @order_cycles && @order_cycles.empty? && - current_distributor.preferred_shopfront_closed_message.present? + no_open_order_cycles? && current_distributor.preferred_shopfront_closed_message.present? + end + + def no_open_order_cycles? + @order_cycles && @order_cycles.empty? end end diff --git a/app/views/shopping_shared/_order_cycles.html.haml b/app/views/shopping_shared/_order_cycles.html.haml index df7bcddd0c..6fab77ffe9 100644 --- a/app/views/shopping_shared/_order_cycles.html.haml +++ b/app/views/shopping_shared/_order_cycles.html.haml @@ -3,6 +3,6 @@ %ordercycle{"ng-controller" => "OrderCycleCtrl"} - - unless @order_cycles and @order_cycles.empty? + - unless no_open_order_cycles? %form.custom = yield :order_cycle_form diff --git a/app/views/shopping_shared/tabs/_shop.html.haml b/app/views/shopping_shared/tabs/_shop.html.haml index 4b4c1c1fa4..7352cd0a3b 100644 --- a/app/views/shopping_shared/tabs/_shop.html.haml +++ b/app/views/shopping_shared/tabs/_shop.html.haml @@ -1,7 +1,7 @@ %script{ type: "text/ng-template", id: "shop/shop.html" } .row .small-12.columns - - if @order_cycles and @order_cycles.empty? + - if no_open_order_cycles? .content %h4 %i.ofn-i_012-warning