diff options
| -rw-r--r-- | jakob/dynamic/capabilities/comments.scm | 21 | ||||
| -rw-r--r-- | pages/changelog.org | 6 |
2 files changed, 23 insertions, 4 deletions
diff --git a/jakob/dynamic/capabilities/comments.scm b/jakob/dynamic/capabilities/comments.scm index d2e34dc..fe355e2 100644 --- a/jakob/dynamic/capabilities/comments.scm +++ b/jakob/dynamic/capabilities/comments.scm @@ -15,6 +15,7 @@ ;;; <http://www.gnu.org/licenses/>. (define-module (jakob dynamic capabilities comments) + #:use-module (haunt html) #:use-module (ice-9 match) #:use-module (jakob dynamic capabilities common) #:use-module (jakob dynamic captcha) @@ -23,6 +24,7 @@ #:use-module (jakob dynamic logging) #:use-module (jakob dynamic notify) #:use-module (jakob dynamic util) + #:use-module (jakob theme) #:use-module (json) #:use-module (squee) #:use-module (srfi srfi-1) @@ -148,10 +150,21 @@ This is a wrapper around `get-comments-by-slug'." (assoc-value form-data "reply-to") #f) (request-originating-network request))) - (values (build-response - #:code 307 - #:headers '((Location . "https://jakob.space"))) - (scm->json-string `((success . #t))))) + (if (equal? "application/json" (assoc-ref (request-headers request) 'accept)) + (values (build-response #:code 202 + #:headers '((content-type . (application/json)))) + (scm->json-string `((success . #t)))) + (values (build-response #:code 202 + #:headers '((content-type . (text/html)))) + (sxml->html-string + (theme #:title "Comment Posted!" + #:content + `(div (h2 "Comment successfully posted!") + (p "Thanks! Comments on this site are subject to " + (em "manual approval") + ", so it may be some time before you see your comment. " + "But if you're seeing this, we did receive it!") + (p (a (@ (href "/")) "Click here to return to the homepage.")))))))) (let ((form-data (decode-form body))) (unless (assoc "slug" form-data) (panic "missing param `slug'")) (unless (assoc "name" form-data) (panic "missing param `name'")) diff --git a/pages/changelog.org b/pages/changelog.org index abf046f..2591ca2 100644 --- a/pages/changelog.org +++ b/pages/changelog.org @@ -1,7 +1,13 @@ +#+TITLE: Changelog + * Site Changelog A record of any notable user-facing changes made to this website. For more detail, refer to the log of the [[https://git.sr.ht/~jakob/blog][Git repository]]. +** Sunday, August 11, 2024 + +- Added an indication that posting a comment was successful, instead of just redirecting to the index. + ** Sunday, December 24, 2023 - Updated the header bar. I don't see the point in having a user-facing link to the Atom feed, since any reader software worth its weight will be able to pick up on my site having a feed automatically. |