summaryrefslogtreecommitdiffstatshomepage
path: root/tekuti/page-helpers.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tekuti/page-helpers.scm')
-rw-r--r--tekuti/page-helpers.scm16
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)))