diff --git a/pkg/controller/comment/post_comment.go b/pkg/controller/comment/post_comment.go index fd7d4c5..209f16e 100644 --- a/pkg/controller/comment/post_comment.go +++ b/pkg/controller/comment/post_comment.go @@ -131,6 +131,13 @@ func PostComment() http.HandlerFunc { if r.Method == http.MethodPost { // Default intent is preview unless told to submit. if intent == "submit" { + // A message is required. + if message == "" { + session.FlashError(w, r, "A message is required for your comment.") + templates.Redirect(w, fromURL) + return + } + // Are we modifying an existing comment? if comment != nil { comment.Message = message diff --git a/web/templates/photo/permalink.html b/web/templates/photo/permalink.html index a1aa4d8..3f8cb3a 100644 --- a/web/templates/photo/permalink.html +++ b/web/templates/photo/permalink.html @@ -161,7 +161,8 @@ + placeholder="Add your comment" + required>
Markdown formatting supported.