Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Moved out paths partial from core to frontend/backend

Damian Legawiecfb44fbcecb24
diff --git a/backend/app/views/spree/admin/shared/_head.html.erb b/backend/app/views/spree/admin/shared/_head.html.erb
index 89cafe1c9d..086f37619a 100644
--- a/backend/app/views/spree/admin/shared/_head.html.erb
+++ b/backend/app/views/spree/admin/shared/_head.html.erb
@@ -15,7 +15,7 @@
<%= stylesheet_link_tag 'spree/backend/all', media: :all %>
-<%= render 'spree/shared/paths' %>
+<%= render 'spree/admin/shared/paths' %>
<%= javascript_include_tag 'spree/backend/all' %>
<%= render "spree/admin/shared/translations" %>
diff --git a/core/app/views/spree/shared/_paths.html.erb b/backend/app/views/spree/admin/shared/_paths.html.erb
similarity index 100%
rename from core/app/views/spree/shared/_paths.html.erb
rename to backend/app/views/spree/admin/shared/_paths.html.erb
diff --git a/frontend/app/views/spree/shared/_paths.html.erb b/frontend/app/views/spree/shared/_paths.html.erb
new file mode 100644
index 0000000000..d8fa9c7062
--- /dev/null
+++ b/frontend/app/views/spree/shared/_paths.html.erb
@@ -0,0 +1,8 @@
+<script>
+ SpreePaths = <%==
+ {
+ mounted_at: Rails.application.routes.url_helpers.spree_path(trailing_slash: true),
+ admin: Spree.admin_path.gsub(/\A(\/)?(.*[^\/])(\/)?\z/, '\\2/')
+ }.to_json
+ %>
+</script>