diff options
author | 2011-02-18 23:34:17 +0100 | |
---|---|---|
committer | 2011-02-18 23:34:17 +0100 | |
commit | a357b2a0dc0d4b109df8e9207d0fcc90a214d2d3 (patch) | |
tree | 8bfaf98e70cc213a1d134c85e2edbaf759ef2d9b /tekuti/page-helpers.scm | |
parent | 9ec70ebff5188e55a2f0765b9f60be9ef0b3a22b (diff) | |
download | tekuti-a357b2a0dc0d4b109df8e9207d0fcc90a214d2d3.tar.gz tekuti-a357b2a0dc0d4b109df8e9207d0fcc90a214d2d3.zip |
support for deleting post comments
Diffstat (limited to 'tekuti/page-helpers.scm')
-rw-r--r-- | tekuti/page-helpers.scm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tekuti/page-helpers.scm b/tekuti/page-helpers.scm index 7e7be48..5d2b7cc 100644 --- a/tekuti/page-helpers.scm +++ b/tekuti/page-helpers.scm @@ -192,6 +192,10 @@ (action ,(relurl `("admin" "delete-post" ,(post-key post))))) " " (input (@ (type "submit") (name "delete") (value "delete")))) + ,@(let ((l (comments-sxml-content-edit post))) + (if (null? l) l + `((h2 "comments") + (ol (@ (class "commentlist")) ,@l)))) (h2 "preview") ,(show-post post #f)) '()))) @@ -238,6 +242,18 @@ (p (input (@ (name "submit") (type "submit") (id "submit") (tabindex "5") (value "Submit Comment")))))) +(define (comments-sxml-content-edit post) + (map + (lambda (comment) + (let ((id (assq-ref comment 'key))) + `(,(comment-sxml-content comment) + (form (@ (method "POST") + (action ,(relurl `("admin" "delete-comment" + ,(post-key post) ,id)))) + (input (@ (type "submit") (name "delete") (value "delete")))) + (br)))) + (post-comments post))) + (define (post-sxml-comments post) (let ((comments (post-comments post)) (comments-open? (post-comments-open? post))) |