aboutsummaryrefslogtreecommitdiff
path: root/haunt/jakob/builder
diff options
context:
space:
mode:
authorJakob L. Kreuze2022-11-20 13:29:29 -0500
committerJakob L. Kreuze2022-11-20 13:29:29 -0500
commit7092a1977d075001320470d81cc740d33409cc64 (patch)
treed61003453c681f8d732d73255e12b0916f3aa1ad /haunt/jakob/builder
parentebeeb7518241bea945b6c372fe07fb20abf020f3 (diff)
[dynamic] Initial dynamically-loaded comment form
To curb constraints surrounding where and when dynamic content can appear, the comment form _embedded into the page for a blog post_ is dynamically loaded by some JavaScript code. This is the initial implementation of that. There are a few parts of this implementation that need to be improved: - Make it clear that the captcha is the only part that's being loaded by XHR. i.e., display the form with a "loading..." placeholder where the captcha image should be. - Have this triggered by the user, so the API doesn't get flooded with requests that aren't going to be completed. (The ratio of readers to commenters is likely to be very high.)
Diffstat (limited to 'haunt/jakob/builder')
-rw-r--r--haunt/jakob/builder/blog.scm12
1 files changed, 7 insertions, 5 deletions
diff --git a/haunt/jakob/builder/blog.scm b/haunt/jakob/builder/blog.scm
index 531804b..ba8a5ee 100644
--- a/haunt/jakob/builder/blog.scm
+++ b/haunt/jakob/builder/blog.scm
@@ -21,6 +21,7 @@
#:use-module (haunt utils)
#:use-module (ice-9 format)
#:use-module (ice-9 match)
+ #:use-module (jakob dynamic capabilities comment-form)
#:use-module (jakob theme)
#:use-module (jakob utils)
#:use-module (jakob utils pagination)
@@ -72,8 +73,12 @@
(article ,(post-sxml post))
(section
(@ (id "webmention"))
- (h2 ,(hyperlink "https://indieweb.org/Webmention" "Webmentions")
- " for this Page")
+ (h2 "Comments for this page")
+ (ul (@ (id "webmention-container"))
+ ;; ,@(render-comment-view (fetch-webmentions (post-identifier post))))
+ ,@(render-comment-view (fetch-comments (post-identifier post))))
+ (div (@ (id "dynamic-comment-form-insert") (hidden #t))
+ ,(render-comment-form (post-identifier post) #:header-level 'h3))
(p "Click " ,(hyperlink (build-comment-url post) "here") " to write a comment on this post.")
(form
(@ (id "webmention-form")
@@ -84,9 +89,6 @@
", you can let me know the URL:")
(input (@ (name "source") (type "url")))
(input (@ (value "Send Webmention") (type "submit"))))
- (ul (@ (id "webmention-container"))
- ;; ,@(render-comment-view (fetch-webmentions (post-identifier post))))
- ,@(render-comment-view (fetch-comments (post-identifier post))))
,(script "section-folds.js")
;; ,(script "webmention.js")
)))

© 2015 - 2026 Jakob L. Kreuze