diff --git a/app/views/enterprises/shop.html.haml b/app/views/enterprises/shop.html.haml
index 3008b50d49..150452a4e9 100644
--- a/app/views/enterprises/shop.html.haml
+++ b/app/views/enterprises/shop.html.haml
@@ -8,6 +8,10 @@
- content_for :injection_data do
- cache(*CacheService::FragmentCaching.ams_shop(@enterprise)) do
= inject_enterprise_shopfront(@enterprise)
+ - cache(*CacheService::FragmentCaching.ams_all_taxons) do
+ = inject_taxons
+ - cache(*CacheService::FragmentCaching.ams_all_properties) do
+ = inject_properties
%shop.darkswarm
- if @shopfront_layout == 'embedded'
diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml
index b5622063a2..233806ce92 100644
--- a/app/views/groups/show.html.haml
+++ b/app/views/groups/show.html.haml
@@ -5,10 +5,17 @@
- content_for(:image) do
= @group.logo.url
+- content_for :scripts do
+ = render partial: "shared/google_maps_js"
+
- content_for :injection_data do
= inject_available_countries
= inject_group_enterprises
= inject_open_street_map_config
+ - cache(*CacheService::FragmentCaching.ams_all_taxons) do
+ = inject_taxons
+ - cache(*CacheService::FragmentCaching.ams_all_properties) do
+ = inject_properties
#group-page.row.pad-top.footer-pad{"ng-controller" => "GroupPageCtrl"}
.small-12.columns.pad-top
diff --git a/app/views/layouts/darkswarm.html.haml b/app/views/layouts/darkswarm.html.haml
index e745a20b3c..de1f90b8fa 100644
--- a/app/views/layouts/darkswarm.html.haml
+++ b/app/views/layouts/darkswarm.html.haml
@@ -42,22 +42,15 @@
- if Spree::Config.stripe_connect_enabled
= render "shared/stripe_js"
-
- - if !ContentConfig.open_street_map_enabled
- %script{src: "//maps.googleapis.com/maps/api/js?libraries=places,geometry#{ ENV['GOOGLE_MAPS_API_KEY'] ? '&key=' + ENV['GOOGLE_MAPS_API_KEY'] : ''} "}
-
= javascript_include_tag "darkswarm/all"
= javascript_include_tag "web/all"
= render "layouts/i18n_script"
+
= yield :scripts
= inject_current_hub
= inject_current_user
= inject_rails_flash
- - cache(*CacheService::FragmentCaching.ams_all_taxons) do
- = inject_taxons
- - cache(*CacheService::FragmentCaching.ams_all_properties) do
- = inject_properties
= inject_current_order
= inject_currency_config
= yield :injection_data
diff --git a/app/views/map/index.html.haml b/app/views/map/index.html.haml
index 42b0000d19..cdbd97de85 100644
--- a/app/views/map/index.html.haml
+++ b/app/views/map/index.html.haml
@@ -1,9 +1,16 @@
- content_for(:title) do
= t :map_title
+- content_for :scripts do
+ = render partial: "shared/google_maps_js"
+
- content_for :injection_data do
= inject_available_countries
= inject_enterprise_shopfront_list
= inject_open_street_map_config
+ - cache(*CacheService::FragmentCaching.ams_all_taxons) do
+ = inject_taxons
+ - cache(*CacheService::FragmentCaching.ams_all_properties) do
+ = inject_properties
= render partial: "shared/map"
diff --git a/app/views/producers/index.html.haml b/app/views/producers/index.html.haml
index b00268066b..8c0b30246e 100644
--- a/app/views/producers/index.html.haml
+++ b/app/views/producers/index.html.haml
@@ -1,9 +1,16 @@
- content_for(:title) do
= t :producers_title
+- content_for :scripts do
+ = render partial: "shared/google_maps_js"
+
- content_for :injection_data do
- cache @enterprises do
= inject_enterprises(@enterprises)
+ - cache(*CacheService::FragmentCaching.ams_all_taxons) do
+ = inject_taxons
+ - cache(*CacheService::FragmentCaching.ams_all_properties) do
+ = inject_properties
.producers{"ng-controller" => "EnterprisesCtrl", "ng-cloak" => true}
.row
diff --git a/app/views/registration/index.html.haml b/app/views/registration/index.html.haml
index 5c2e63f0e4..b29e3e8bc3 100644
--- a/app/views/registration/index.html.haml
+++ b/app/views/registration/index.html.haml
@@ -1,6 +1,9 @@
- content_for(:title) do
= t :register_title
+- content_for :scripts do
+ = render partial: "shared/google_maps_js"
+
- content_for :injection_data do
= inject_spree_api_key
= inject_available_countries
diff --git a/app/views/shared/_google_maps_js.html.haml b/app/views/shared/_google_maps_js.html.haml
new file mode 100644
index 0000000000..7772240117
--- /dev/null
+++ b/app/views/shared/_google_maps_js.html.haml
@@ -0,0 +1,2 @@
+- if !ContentConfig.open_street_map_enabled
+ %script{src: "//maps.googleapis.com/maps/api/js?libraries=places,geometry#{ ENV['GOOGLE_MAPS_API_KEY'] ? '&key=' + ENV['GOOGLE_MAPS_API_KEY'] : ''} "}
diff --git a/app/views/shops/index.html.haml b/app/views/shops/index.html.haml
index 032096ebb9..ec5326a319 100644
--- a/app/views/shops/index.html.haml
+++ b/app/views/shops/index.html.haml
@@ -1,9 +1,16 @@
- content_for(:title) do
= t :shops_title
+- content_for :scripts do
+ = render partial: "shared/google_maps_js"
+
- content_for :injection_data do
- cache(*CacheService::FragmentCaching.ams_shops) do
= inject_enterprises(@enterprises)
+ - cache(*CacheService::FragmentCaching.ams_all_taxons) do
+ = inject_taxons
+ - cache(*CacheService::FragmentCaching.ams_all_properties) do
+ = inject_properties
#panes
#shops.pane