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

@@ -6,6 +6,7 @@ defmodule BerrypodWeb.ShopComponents.Cart do
import BerrypodWeb.ShopComponents.Base
alias Berrypod.Products.{Product, ProductImage}
alias BerrypodWeb.R
defp close_cart_drawer_js do
Phoenix.LiveView.JS.push("close_cart_drawer")
@@ -193,7 +194,7 @@ defmodule BerrypodWeb.ShopComponents.Cart do
>
<%= if @mode != :preview do %>
<.link
patch={"/products/#{@item.product_id}"}
patch={R.product(@item.product_id)}
class={["cart-item-image", !@item.image && "cart-item-image--empty"]}
data-size={if @size == :compact, do: "compact"}
style={if @item.image, do: "background-image: url('#{@item.image}');"}
@@ -212,7 +213,7 @@ defmodule BerrypodWeb.ShopComponents.Cart do
<h3 class="cart-item-name" data-size={if @size == :compact, do: "compact"}>
<%= if @mode != :preview do %>
<.link
patch={"/products/#{@item.product_id}"}
patch={R.product(@item.product_id)}
class="cart-item-name-link"
>
{@item.name}
@@ -321,7 +322,7 @@ defmodule BerrypodWeb.ShopComponents.Cart do
</button>
<% else %>
<.link
patch="/collections/all"
patch={R.collection("all")}
class="cart-continue-link"
>
Continue shopping
@@ -533,7 +534,7 @@ defmodule BerrypodWeb.ShopComponents.Cart do
</.shop_button>
<p class="order-summary-notice">Checkout isn't available yet.</p>
<.shop_link_outline
href="/collections/all"
href={R.collection("all")}
class="order-summary-continue"
>
Continue shopping
@@ -544,7 +545,7 @@ defmodule BerrypodWeb.ShopComponents.Cart do
</.shop_button>
<p class="order-summary-notice">Remove unavailable items to checkout.</p>
<.shop_link_outline
href="/collections/all"
href={R.collection("all")}
class="order-summary-continue"
>
Continue shopping
@@ -557,7 +558,7 @@ defmodule BerrypodWeb.ShopComponents.Cart do
</.shop_button>
</form>
<.shop_link_outline
href="/collections/all"
href={R.collection("all")}
class="order-summary-continue"
>
Continue shopping