add admin CRUD for custom CMS pages
All checks were successful
deploy / deploy (push) Successful in 1m21s
All checks were successful
deploy / deploy (push) Successful in 1m21s
New settings form for creating and editing custom page metadata (title, slug, meta description, published, nav settings). Pages index shows custom pages section with draft badges and delete. Editor shows settings button for custom pages, hides reset to defaults. 20 new tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
12
PROGRESS.md
12
PROGRESS.md
@@ -9,7 +9,7 @@
|
||||
- Image optimization pipeline (AVIF/WebP/JPEG responsive variants)
|
||||
- Shop pages (home, collections, products, cart, about, contact, error, delivery, privacy, terms)
|
||||
- Mobile-first design with bottom navigation
|
||||
- 1398 tests passing, 100% PageSpeed score
|
||||
- 1455 tests passing, 100% PageSpeed score
|
||||
- SQLite production tuning (IMMEDIATE transactions, mmap, WAL journal limit)
|
||||
- Variant selector with color swatches and size buttons
|
||||
- Session-based cart with real variant data (add/remove/quantity, cross-tab sync)
|
||||
@@ -143,9 +143,9 @@ Plans: [admin-redesign.md](docs/plans/admin-redesign.md) | [admin-font-loading.m
|
||||
| ~~95~~ | ~~Image picker for page builder — `:image` field type, image_id resolution in renderer~~ | 94 | 2h | done |
|
||||
| 96 | Polish — theme editor alt text, full modal picker, orphan cleanup on ref removal | 95 | 1h | planned |
|
||||
| | **Custom CMS pages** ([plan](docs/plans/custom-pages.md)) | | | |
|
||||
| 97 | Stage 1: data model + context — schema fields, split changeset, CRUD functions, cache | — | 1.5h | planned |
|
||||
| 98 | Stage 2: routing + LiveView — `Shop.CustomPage`, catch-all route, 404 handling | 97 | 1h | planned |
|
||||
| 99 | Stage 3: admin CRUD — create/edit/delete pages, page settings, admin index | 98 | 2.5h | planned |
|
||||
| ~~97~~ | ~~Stage 1: data model + context — schema fields, split changeset, CRUD functions, cache~~ | — | 1.5h | done |
|
||||
| ~~98~~ | ~~Stage 2: routing + LiveView — `Shop.CustomPage`, catch-all route, 404 handling~~ | 97 | 1h | done |
|
||||
| ~~99~~ | ~~Stage 3: admin CRUD — create/edit/delete pages, page settings, admin index~~ | 98 | 2.5h | done |
|
||||
| 100 | Stage 4: navigation management — data-driven nav, settings storage, admin editor | 99 | 3h | planned |
|
||||
| 101 | Stage 5: SEO + redirects — sitemap, auto-redirect on slug change, draft/published | 100 | 1h | planned |
|
||||
| 102 | Stage 6: polish — page templates, new block types, bulk ops | 101 | 3-4h | deferred |
|
||||
@@ -487,7 +487,7 @@ Admin media library at `/admin/media` with image grid, type/search/orphan filter
|
||||
See: [docs/plans/media-library.md](docs/plans/media-library.md) for full plan
|
||||
|
||||
### Page Editor
|
||||
**Status:** In progress — Stage 8 of 9 complete, 1370 tests
|
||||
**Status:** In progress — Stage 8 of 9 complete, 1455 tests
|
||||
|
||||
Database-driven page builder. Every page is a flat list of blocks stored as JSON — add, remove, reorder, and edit blocks on any page. One generic renderer for all pages (no page-specific render functions). Portable blocks (hero, featured_products, image_text, etc.) work on any page. Page-specific blocks (product_hero, cart_items, etc.) are restricted to their native page. Block data loaders dynamically load data based on which blocks are on the page. ETS-cached page definitions. Mobile-first admin editor with live preview, undo/redo, accessible reordering (no drag-and-drop), inline settings forms, and "reset to defaults". CSS-driven page layout (not renderer-driven).
|
||||
|
||||
@@ -508,7 +508,7 @@ Database-driven page builder. Every page is a flat list of blocks stored as JSON
|
||||
- `lib/berrypod/pages/` — Page schema, BlockTypes (26 types), Defaults (14 pages), PageCache (ETS)
|
||||
- `lib/berrypod_web/page_renderer.ex` — generic renderer dispatching blocks to existing shop components
|
||||
- `lib/berrypod_web/live/admin/pages/` — Index (page list) + Editor (block management)
|
||||
- `test/berrypod/pages_test.exs` — 34 tests
|
||||
- `test/berrypod/pages_test.exs` — 62 tests
|
||||
- `test/berrypod_web/page_renderer_test.exs` — 18 tests
|
||||
- `lib/berrypod/pages/settings_field.ex` — typed struct for settings schema fields
|
||||
- `lib/berrypod/pages/block_editor.ex` — pure functions for block manipulation
|
||||
|
||||
Reference in New Issue
Block a user