mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-27 06:05:19 +00:00
Merge pull request #8060 from Matt-Yorkley/script-split
Maps and AMS conditional loading
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
2
app/views/shared/_google_maps_js.html.haml
Normal file
2
app/views/shared/_google_maps_js.html.haml
Normal file
@@ -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'] : ''} "}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user