diff --git a/AGENTS.md b/AGENTS.md index 62d1c71..c47b28a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -154,6 +154,8 @@ To add an email block type: add to `EmailBlockType` in `packages/shared/src/type ### Routing - **Admin app** (`app-admin`): All routes except `/login` are auth-guarded in `hooks.server.ts` (which also refreshes the token per request and sets the cookie's `Secure` flag from the real scheme). The root layout renders the admin shell (grouped sidebar) except on `/login` and `/preview`. The `/preview` route reads `sessionStorage` set by the page editor (same-origin, so it works). - **Public app** (`app-public`): No auth guard. The root layout always renders Header/Footer. `+layout.server.ts` fetches header/footer/colors globals + basket/items/slots for every page. +- **Booking and basket links**: booking = the header CTA's address, basket = the optional basket page slug typed in Site design (`header.basketPage`; '' = the CTA's address), both from `shopLinks(header)` in `packages/shared/src/types.ts` (blocks read `page.data.header`) — never hard-code `/book`. +- **Class names in components are written out whole** (`'btn-primary'`, not `` `btn-${variant}` ``): Tailwind only generates classes it finds in the source, so a built-up name silently gets no style. - `+page.server.ts` for home fetches `slug = "home" && published = true` - `[slug]/+page.server.ts` fetches by dynamic slug diff --git a/README.md b/README.md index f0ba0af..4d5e826 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ Setup: ``` Copy the printed `whsec_…` signing secret into `STRIPE_WEBHOOK_SECRET`. 4. Import the updated `pb_schema.json` (adds `items`, `slots`, `baskets`, `basket_lines`, `orders`, `order_lines`). Two visitors can't take the same place: holds are checked and written in one PocketBase transaction (see *Slot availability*). -5. Create a published page (e.g. slug `book`) with a `shop` block and a `checkout` block, and point the header CTA at it. +5. Create a published page (e.g. slug `book`) with a `shop` block and point the header CTA at it (*Site design → Header*); hero buttons without an address and *Book another* after paying lead there too. Put a `checkout` block on the same page, or on a page of its own whose slug you type as the optional *Basket page*: the basket in the header and *view basket* in the shop lead there (empty = the CTA's address). Site design warns when the basket's page isn't published or has no `checkout` block. ## Bundles and codes diff --git a/app-admin/src/lib/admin/blockDefaults.ts b/app-admin/src/lib/admin/blockDefaults.ts index 28fcf95..5b6f454 100644 --- a/app-admin/src/lib/admin/blockDefaults.ts +++ b/app-admin/src/lib/admin/blockDefaults.ts @@ -33,7 +33,7 @@ export function createBlock(type: BlockType): ContentBlock { heading: 'Holistic and Experiential Learning about Happiness', subheading: 'Individual sessions, workshops and events in Oslo', buttonLabel: 'BOOK NOW', - buttonUrl: '/book' + buttonUrl: '' }; break; case 'button': diff --git a/app-admin/src/lib/admin/editors/BlockEditor.svelte b/app-admin/src/lib/admin/editors/BlockEditor.svelte index e2e9ec2..cb756f7 100644 --- a/app-admin/src/lib/admin/editors/BlockEditor.svelte +++ b/app-admin/src/lib/admin/editors/BlockEditor.svelte @@ -101,7 +101,7 @@ {@render field('Subheading', block.data.subheading || '', (subheading) => updateData({ subheading }))}