aboutsummaryrefslogtreecommitdiff
path: root/haunt/jakob/dynamic/capabilities/comment-form.scm
diff options
context:
space:
mode:
authorJakob L. Kreuze2022-11-19 10:44:34 -0500
committerJakob L. Kreuze2022-11-19 12:27:24 -0500
commit5e65e1f8b1ca842001623974b9cb0e97d2771034 (patch)
treea9c5ee7e2f280ce9baf157f55eb41f3c2036c2b6 /haunt/jakob/dynamic/capabilities/comment-form.scm
parentb76baf7a09b958b3c447a5104ffdc164537f925e (diff)
[dynamic] Initial stateful implementation of the LaTeX captcha
Diffstat (limited to 'haunt/jakob/dynamic/capabilities/comment-form.scm')
-rw-r--r--haunt/jakob/dynamic/capabilities/comment-form.scm13
1 files changed, 6 insertions, 7 deletions
diff --git a/haunt/jakob/dynamic/capabilities/comment-form.scm b/haunt/jakob/dynamic/capabilities/comment-form.scm
index 70e5303..1754dfd 100644
--- a/haunt/jakob/dynamic/capabilities/comment-form.scm
+++ b/haunt/jakob/dynamic/capabilities/comment-form.scm
@@ -30,14 +30,13 @@
#:export (get-comment-form))
(define (render-comment-form slug)
- (let-values (((mac solution captcha-image) (new-captcha)))
+ (let-values (((captcha-id captcha-image) (new-captcha!)))
`((div (@ (id "comment-form"))
(h1 "Comment form")
(form (@ (id "comment-input") (action "/api/comment") (method "post"))
(input (@ (type "text") (name "slug") (hidden #t) (value ,slug)))
- (input (@ (type "text") (name "solution") (hidden #t) (value ,solution)))
- (input (@ (type "text") (name "solution-mac") (hidden #t) (value ,mac)))
- (fieldset
+ (input (@ (type "text") (name "captcha-id") (hidden #t) (value ,captcha-id)))
+ (fieldset (@ (id "commenter-info"))
(legend "Commenter Info")
(label (@ (for "name")) "Name:")
(input (@ (type "text") (id "name") (name "name") (required #t) (size 24)))
@@ -45,15 +44,15 @@
(input (@ (type "text") (id "email") (name "email") (size 24)))
(label (@ (for "url")) "Webpage URL (optional):")
(input (@ (type "text") (id "url") (name "url") (size 24))))
- (fieldset
+ (fieldset (@ (id "comment-content"))
(legend "Comment")
(label (@ (for "subject")) "Subject (optional):")
(input (@ (type "text") (id "subject") (name "subject") (size 24)))
(label (@ (for "comment")) "Comment :")
(textarea (@ (id "coment") (name "comment") (rows 4) (cols 50))))
- (fieldset
+ (fieldset (@ (id "comment-captcha"))
(legend "Captcha")
- (label (@ (for "captcha")) "Captcha:")
+ (label (@ (for "captcha")) "Please evaluate the following definite integral:")
(img (@ (src ,(format #f "data:image/jpeg;charset=utf-8;base64,~a"
(base64-encode captcha-image)))))
(input (@ (type "text") (id "captcha") (name "captcha") (size 24)))

© 2015 - 2026 Jakob L. Kreuze