integrate R module and add url editor ui

Replaces hardcoded paths with R module throughout:
- Shop components: layout nav, cart, product links
- Controllers: cart, checkout, contact, seo, order lookup
- Shop pages: collection, product, search, checkout success, etc.
- Site context: nav item url resolution

Admin URL management:
- Settings page: prefix editor with validation feedback
- Page renderer: url_editor component for page URLs
- CSS for url editor styling

Test updates for cache isolation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-04-01 00:36:17 +01:00
parent c115f08cb8
commit a41771efc8
28 changed files with 938 additions and 160 deletions

View File

@@ -9,6 +9,7 @@ defmodule BerrypodWeb.Shop.Pages.Content do
alias Berrypod.LegalPages
alias Berrypod.Pages
alias Berrypod.Theme.PreviewData
alias BerrypodWeb.R
def init(socket, _params, _uri) do
# Content pages load in handle_params based on live_action
@@ -38,7 +39,7 @@ defmodule BerrypodWeb.Shop.Pages.Content do
%{
page_title: "About",
page_description: "Your story goes here this is sample content for the demo shop",
og_url: BerrypodWeb.Endpoint.url() <> "/about"
og_url: R.url(R.about())
},
PreviewData.about_content()
}
@@ -49,7 +50,7 @@ defmodule BerrypodWeb.Shop.Pages.Content do
%{
page_title: "Delivery & returns",
page_description: "Everything you need to know about shipping and returns.",
og_url: BerrypodWeb.Endpoint.url() <> "/delivery"
og_url: R.url(R.delivery())
},
LegalPages.delivery_content()
}
@@ -60,7 +61,7 @@ defmodule BerrypodWeb.Shop.Pages.Content do
%{
page_title: "Privacy policy",
page_description: "How we handle your personal information.",
og_url: BerrypodWeb.Endpoint.url() <> "/privacy"
og_url: R.url(R.privacy())
},
LegalPages.privacy_content()
}
@@ -71,7 +72,7 @@ defmodule BerrypodWeb.Shop.Pages.Content do
%{
page_title: "Terms of service",
page_description: "The terms and conditions governing purchases from our shop.",
og_url: BerrypodWeb.Endpoint.url() <> "/terms"
og_url: R.url(R.terms())
},
LegalPages.terms_content()
}