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:
@@ -19,7 +19,7 @@ defmodule BerrypodWeb.OrderLookupController do
|
||||
:error,
|
||||
"No orders found for that address. Make sure you use the same email you checked out with."
|
||||
)
|
||||
|> redirect(to: ~p"/contact")
|
||||
|> redirect(to: R.contact())
|
||||
else
|
||||
token = generate_token(email)
|
||||
link = BerrypodWeb.Endpoint.url() <> ~p"/orders/verify/#{token}"
|
||||
@@ -30,14 +30,14 @@ defmodule BerrypodWeb.OrderLookupController do
|
||||
:info,
|
||||
"We've sent a link to your email address. It'll expire after an hour."
|
||||
)
|
||||
|> redirect(to: ~p"/contact")
|
||||
|> redirect(to: R.contact())
|
||||
end
|
||||
end
|
||||
|
||||
def lookup(conn, _params) do
|
||||
conn
|
||||
|> put_flash(:error, "Please enter your email address.")
|
||||
|> redirect(to: ~p"/contact")
|
||||
|> redirect(to: R.contact())
|
||||
end
|
||||
|
||||
def verify(conn, %{"token" => token}) do
|
||||
@@ -45,17 +45,17 @@ defmodule BerrypodWeb.OrderLookupController do
|
||||
{:ok, email} ->
|
||||
conn
|
||||
|> put_session(:order_lookup_email, email)
|
||||
|> redirect(to: ~p"/orders")
|
||||
|> redirect(to: R.orders())
|
||||
|
||||
{:error, :expired} ->
|
||||
conn
|
||||
|> put_flash(:error, "That link has expired. Please request a new one.")
|
||||
|> redirect(to: ~p"/contact")
|
||||
|> redirect(to: R.contact())
|
||||
|
||||
{:error, _} ->
|
||||
conn
|
||||
|> put_flash(:error, "That link is invalid.")
|
||||
|> redirect(to: ~p"/contact")
|
||||
|> redirect(to: R.contact())
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user