wire order pages and theme preview to page renderer, remove old templates
Some checks failed
deploy / deploy (push) Has been cancelled
Some checks failed
deploy / deploy (push) Has been cancelled
All 14 pages now render through PageRenderer. Theme editor preview unified from 10 preview_page clauses to one function + page-context helpers. PageTemplates module and 10 .heex template files deleted. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
defmodule BerrypodWeb.PageTemplates do
|
||||
@moduledoc """
|
||||
Shared page templates used by both the public shop and theme preview.
|
||||
|
||||
These templates accept a `mode` parameter to control navigation behavior:
|
||||
- `:shop` - Links navigate normally (real shop pages)
|
||||
- `:preview` - Links send events to parent LiveView (theme editor)
|
||||
|
||||
All templates expect these common assigns:
|
||||
- `theme_settings` - Current theme configuration
|
||||
- `logo_image` - Logo image struct or nil
|
||||
- `header_image` - Header image struct or nil
|
||||
- `mode` - `:shop` or `:preview`
|
||||
- `cart_items` - List of cart items (can be empty)
|
||||
- `cart_count` - Number of items in cart
|
||||
"""
|
||||
use Phoenix.Component
|
||||
use BerrypodWeb.ShopComponents
|
||||
|
||||
embed_templates "page_templates/*"
|
||||
|
||||
def format_order_status("unfulfilled"), do: "Being prepared"
|
||||
def format_order_status("submitted"), do: "Sent to printer"
|
||||
def format_order_status("processing"), do: "In production"
|
||||
def format_order_status("shipped"), do: "On its way"
|
||||
def format_order_status("delivered"), do: "Delivered"
|
||||
def format_order_status("failed"), do: "Issue — contact us"
|
||||
def format_order_status("cancelled"), do: "Cancelled"
|
||||
def format_order_status(status), do: status
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user