Commit graph

79 commits

Author SHA1 Message Date
1eb58c71ba Export/import: fix lost images and malformed-file crashes
- An image URL used more than once in the same string (e.g. rich text) was
  only replaced once, leaving broken __IMG__ placeholders after import.
- Images that failed to export were still replaced by placeholders that the
  import could never resolve; keep the original URL instead.
- Validate the uploaded file's shape and JSON (was a 500 on bad input).
- Build lookup filters with pb.filter so names/slugs with quotes don't
  create duplicates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
2026-10-06 10:46:24 +00:00
ff54adb00c Admin server actions: handled errors, timezone-correct times, safer writes
- Slot and timed-event times were parsed in the server's zone (UTC in the
  container) while the form sent the admin's local wall-clock time, so every
  save shifted them by the UTC offset (10:00 → 12:00 in Oslo, again on each
  save). Inputs are now interpreted in SITE_TIMEZONE (shared helpers with
  DST handling), the same setting the booking emails use.
- PocketBase failures in actions (duplicate, validation, relation in use,
  DB down) now return a readable `fail()` instead of a 500 page.
- Pages: 404 for unknown slugs, slug filters built with pb.filter (quotes
  broke them), duplicate-slug check on create/rename (no unique index),
  invalid block JSON rejected instead of throwing; save returns a result so
  the editor can stay on the page.
- Globals: only create a missing record on 404 — any other error (DB
  hiccup) used to create duplicates; save reports success/failure.
- Slots: status is never taken from the form; re-read before update so a
  slot booked or held since the page loaded isn't overwritten; don't delete
  actively held slots.
- Orders: load all order lines in one request instead of one per order.
- Layout exposes site timezone and shop currency for display.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
2026-10-06 10:46:24 +00:00
52d7a5e3e2 Admin shell: standalone login/preview, fixed admin theme
- /login and /preview no longer render the admin navbar (the login page
  showed Pages/Export/Logout to signed-out users; the page preview iframe
  showed the whole admin shell above the draft).
- Site colours from Globals were written onto --color-primary/--color-accent
  of the admin document, which are DaisyUI's theme variables — so the brand
  colour restyled every admin button (low-contrast white-on-sage) and flashed
  after hydration. Apply them only inside /preview; give the admin its own
  sage primary at ~5:1 contrast.
- Login page redesigned with DaisyUI 5 markup (full-width inputs, labels
  above), autocomplete hints, pending state.
- Navbar: active-route highlight, consistent button sizes, wraps instead of
  overflowing on narrow screens.
- Import: confirm before overwriting, show per-item errors instead of
  auto-reloading them away, friendly message for invalid JSON.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
2026-10-06 10:35:15 +00:00
1518f1bbbe Fix admin login/logout over HTTP and stale sessions
- Auth cookie was always exported with the SDK default `Secure` flag, so
  browsers dropped it over plain HTTP (CADDY_SCHEME=http) and login
  looped back to /login. Set `secure` from the real request scheme.
- Logout never ran: the hook redirected every authenticated request to
  /login (including POST /login?/logout) back to /pages. Only redirect GET.
- Refresh the token per request so revoked tokens log the user out instead
  of surfacing as 500s, and sessions slide instead of expiring mid-edit.
- Use `_superusers` instead of the deprecated `pb.admins` alias; keep the
  entered email on a failed login.
- docker-compose: fully-qualified image names (podman rejects short names).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
2026-10-06 10:35:15 +00:00
Jakub Dorfman
fd1afc5f3a fixed image upload 2026-09-28 19:52:24 +02:00
Jakub Dorfman
96828994e1 added mailing through Brevo and node mailer, also a email editor, with
their custom blocks and renderers
2026-09-28 19:25:19 +02:00
Jakub Dorfman
43db707e34 added configurable modes to caddy http/https 2026-08-19 21:16:12 +02:00
Jakub Dorfman
c3989114b8 moved shared code to the shared package 2026-08-19 19:18:31 +02:00
Jakub Dorfman
478a5fd466 moved shared code to the shared package 2026-08-19 19:18:10 +02:00
Jakub Dorfman
1027da989e moved page rendering to a different service and access is now behind
admin.DOMAIN
www.DOMAIN
db.DOMAIN
2026-08-19 17:58:19 +02:00
Jakub Dorfman
c7f6b30b87 removed bare dev fallback routes, only support developmnet in
docker/podman
2026-08-19 13:22:51 +02:00
Jakub Dorfman
702d99b9ed Added shop and checkout to the CMS
Checkout is done with stripe
Added reservation system
2026-07-29 18:18:23 +02:00
Jakub Dorfman
09e54033dd fixed export of images 2026-06-05 16:23:24 +02:00
Jakub Dorfman
3e7a4f8983 fixed pocketbase volume
visual updates to Testimonials and UpcomingCalendar
2026-06-05 15:59:15 +02:00
Jakub Dorfman
246b1990ca added reverse proxy 2026-06-05 15:32:23 +02:00
Jakub Dorfman
afd7fd7686 Contract first version 2026-06-05 14:50:03 +02:00
Jakub Dorfman
63bc055191 calendar and testimonials 2026-06-02 20:45:27 +02:00
Jakub Dorfman
ad34d78d40 Add home page selection to header and increase body size limit in Docker config 2026-06-01 13:34:31 +02:00
Jakub Dorfman
8d8e6cfd27 added page backup 2026-05-27 14:19:12 +02:00
Jakub Dorfman
7d6351f2c5 added import export functionality 2026-05-27 14:17:26 +02:00
Jakub Dorfman
af58adb345 Add subheading color support and update foreground type definitions 2026-05-27 13:56:47 +02:00
Jakub Dorfman
1b94a13d7e nicer timeline 2026-05-20 18:11:22 +02:00
Jakub Dorfman
7aeb1954b2 Added global color defaults 2026-05-20 17:46:30 +02:00
Jakub Dorfman
62f7ac7301 Refactored SegmentedControl
Visual Changes
2026-05-20 16:49:55 +02:00
Jakub Dorfman
5a0ffe20df button and spacer block
visual changes
2026-05-20 15:10:52 +02:00
Jakub Dorfman
1b3ef17800 removed not used blocks 2026-05-20 13:57:07 +02:00
Jakub Dorfman
fe5d77443d fix image upload
visual improvements
2026-05-19 17:11:52 +02:00
Jakub Dorfman
94c1e0b679 Added background and foreground settings to blocks, and scroll in animations 2026-05-18 18:39:49 +02:00
Jakub Dorfman
b4fbf3e411 initial 2026-05-18 17:18:09 +02:00