From 0c82c86c5036ccf02d88ecfe0b6570a5e57ad194 Mon Sep 17 00:00:00 2001 From: lew Date: Tue, 28 Apr 2026 16:27:07 +0100 Subject: [PATCH] chore: update to new guestbook module style --- hosts/lab/guestbook.nix | 58 +++++++++++--------- hosts/lab/templates/default.css | 90 -------------------------------- hosts/lab/templates/default.html | 24 +++++---- 3 files changed, 46 insertions(+), 126 deletions(-) delete mode 100644 hosts/lab/templates/default.css diff --git a/hosts/lab/guestbook.nix b/hosts/lab/guestbook.nix index 630ca5a..8d93c86 100644 --- a/hosts/lab/guestbook.nix +++ b/hosts/lab/guestbook.nix @@ -25,34 +25,42 @@ }; }; - features = { - submissions.enable = true; - websites.enable = true; - drawing = { - enable = true; - canvasWidth = 300; - canvasHeight = 140; - }; - voiceNote = { - enable = true; - maxDuration = 20; - }; - telegram = { - enable = true; - chatId = 8669496383; - botTokenFile = config.sops.secrets.telegram_bot_token.path; - }; - security = { - htmlInjection.enable = true; - honeypot.enable = true; - captcha.enable = false; - }; + submissions.enable = true; + websites.enable = true; + content.required = false; + message.required = false; + + drawing = { + enable = true; + required = false; + }; + + voice = { + enable = true; + required = false; + }; + + telegram = { + enable = true; + chatId = 8669496383; + botTokenFile = config.sops.secrets.telegram_bot_token.path; + }; + + security = { + htmlInjection.enable = true; + honeypot.enable = true; + captcha.enable = false; }; limits = { - name = 0; - message = 0; - website = 0; + name.length = 0; + message.length = 0; + website.length = 0; + drawing = { + width = 300; + height = 140; + }; + voice.duration = 20; }; styles = { diff --git a/hosts/lab/templates/default.css b/hosts/lab/templates/default.css deleted file mode 100644 index f0fc797..0000000 --- a/hosts/lab/templates/default.css +++ /dev/null @@ -1,90 +0,0 @@ -/* Page container */ -.page-container { - max-width: 70ch; - margin: 0 auto; - padding: 1rem; - white-space: pre-wrap; - word-wrap: break-word; -} - -/* Form */ -.guestbook-prompt {} -.guestbook-form {} -.guestbook-label {} -.guestbook-input {} -.guestbook-textarea { - box-sizing: border-box; -} -.guestbook-button { - display: block; - margin-top: 1em; -} - -/* Drawings */ -.guestbook-canvas { - border: 1px solid #000; - cursor: crosshair; - display: block; -} -.guestbook-canvas-tools { - display: block; -} -.guestbook-canvas-tools a { - cursor: pointer; -} -.guestbook-drawing-inline a { - cursor: pointer; -} -.guestbook-drawing-content { - display: block; - margin-bottom: 1em; -} -.guestbook-swatch { - display: inline-block; - width: 0.85em; - height: 0.85em; - border: 1px solid #000; - cursor: pointer; - vertical-align: middle; - box-sizing: border-box; - margin: 0 1px; -} -.guestbook-swatch.active { - border: 1px solid #000; - outline: 1px solid #000; -} -.guestbook-size-slider { - width: 4em; - vertical-align: middle; -} -.entry-drawing { - max-width: 100%; -} - -/* Voice notes */ -.guestbook-voice-record.recording { - color: red; -} -.guestbook-voice-timer { - font-variant-numeric: tabular-nums; -} -.guestbook-voice-playback:empty { - display: none; -} -.guestbook-voice-playback { - display: block; - white-space: normal; -} -audio { - display: block; - margin-top: 0.6em; - height: 2em; -} - -/* Entries */ -.entry-header {} -.entry-date {} -.entry-name {} -.entry-website {} -.entry-body {} -.entry-separator {} diff --git a/hosts/lab/templates/default.html b/hosts/lab/templates/default.html index 5ee2e31..7056b53 100644 --- a/hosts/lab/templates/default.html +++ b/hosts/lab/templates/default.html @@ -3,20 +3,22 @@ - {{title}} + {{title}} — ily.rs {{style}} -
- -{{form}} -{{entries}} -
+ +
+ Click me to leave an entry + {{form}} +
+

messages

+ {{entries}}