summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2020-04-06 00:08:59 +0200
committerRicardo Wurmus <rekado@elephly.net>2020-04-06 00:08:59 +0200
commita38180c536eebb73648cb376b4d12cc87e8a8f19 (patch)
tree2b1f51281c9fcb429b79f1038049b88812c3fcae
parent32361fef718b65d5571d4a625a476ecd8f357ec8 (diff)
view: issue-page: Show comment form.
-rw-r--r--mumi/web/view/html.scm56
1 files changed, 44 insertions, 12 deletions
diff --git a/mumi/web/view/html.scm b/mumi/web/view/html.scm
index 9771dee..d7b04d0 100644
--- a/mumi/web/view/html.scm
+++ b/mumi/web/view/html.scm
@@ -22,6 +22,7 @@
#:use-module (mumi config)
#:use-module (mumi messages)
#:use-module (mumi web view utils)
+ #:use-module (mumi web util)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-19)
@@ -446,19 +447,50 @@ some examples.")
(@ (class "message"))
(div
(@ (class "card"))
- (div
- (@ (class "card-header"))
- (div (@ (class "from"))
- (span (@ (class "address")) "Your comment")))
- (div
- (@ (class "body card-body"))
- (p "Comments via the web interface are not currently
+ ,@(if (mailer-enabled?)
+ `((form
+ (@ (action ,(format #f "/issue/~a/comment"
+ (number->string id)))
+ (enctype "multipart/form-data")
+ (method "POST"))
+ (input (@ (style "display:none")
+ (name "validation")
+ (placeholder "Please leave this empty.")) "")
+ (input (@ (type "hidden")
+ (name "timestamp")
+ (value ,(timestamp!))) "")
+ (div
+ (@ (class "card-header"))
+ (div (@ (class "from"))
+ (input (@ (class "address form-control")
+ (name "from")
+ (required "required")
+ (placeholder "Your name")) "")))
+ (div
+ (@ (class "body card-body"))
+ (textarea (@ (name "text")
+ (required "required")
+ (class "form-control")
+ (placeholder "Please input your comment..."))
+ ""))
+ (div
+ (@ (class "card-footer"))
+ (button (@ (class "btn btn-primary")
+ (type "submit"))
+ "Send"))))
+ `((div
+ (@ (class "card-header"))
+ (div (@ (class "from"))
+ (span (@ (class "address")) "Your comment")))
+ (div
+ (@ (class "body card-body"))
+ (p "Comments via the web interface are not currently
supported. To comment on this conversation "
- (a (@ (href ,(string-append "mailto:"
- (number->string id) "@" (%config 'debbugs-domain)
- "?subject=" (bug-subject* bug))))
- ,(string-append "send email to "
- (number->string id) "@" (%config 'debbugs-domain)))))))))
+ (a (@ (href ,(string-append "mailto:"
+ (number->string id) "@" (%config 'debbugs-domain)
+ "?subject=" (bug-subject* bug))))
+ ,(string-append "send email to "
+ (number->string id) "@" (%config 'debbugs-domain)))))))))))
(div
(@ (class "info col-md-3"))