Instanciate only one ProductsCtrl

- instead of 2: therefore, for each shop display, we only request products one time instead of two times.
This commit is contained in:
Jean-Baptiste Bellet
2021-04-23 20:42:54 +02:00
parent cc85bf791a
commit 71466e643f
3 changed files with 9 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
.content.footer-pad{ "darker-background" => true, "ng-controller" => "ProductsCtrl", "ng-show" => "order_cycle.order_cycle_id == null" }
.content.footer-pad{ "darker-background" => true, "ng-show" => "order_cycle.order_cycle_id == null" }
.row
.small-12.columns
.select-oc-message

View File

@@ -1,5 +1,5 @@
%form{action: main_app.cart_path}
%products{"ng-controller" => "ProductsCtrl", "ng-init" => "refreshStaleData()", "ng-show" => "order_cycle.order_cycle_id != null", "ng-cloak" => true }
%products{"ng-init" => "refreshStaleData()", "ng-show" => "order_cycle.order_cycle_id != null", "ng-cloak" => true }
= render partial: "shop/products/searchbar"

View File

@@ -2,10 +2,11 @@
.order-cycle-bar.hide-for-large-up
= render partial: "shopping_shared/order_cycles"
- if no_open_order_cycles?
= render partial: "shop/messages/closed_shop"
- else
= render partial: "shop/messages/select_oc"
%div{"ng-controller" => "ProductsCtrl"}
- if no_open_order_cycles?
= render partial: "shop/messages/closed_shop"
- else
= render partial: "shop/messages/select_oc"
-# Rendering the form, even if there are no open OCs, makes display only shops possible
= render partial: "shop/products/form"
-# Rendering the form, even if there are no open OCs, makes display only shops possible
= render partial: "shop/products/form"