From ede58653071f8c0018055af852e3b66d15cf8d4b Mon Sep 17 00:00:00 2001 From: rawleyIfowler Date: Mon, 28 Feb 2022 09:12:45 -0600 Subject: [PATCH] fixed broken title for posting comments screens --- controllers/blog.go | 2 +- templates/comment_post.tmpl | 13 ++++++++++++- templates/comment_post_failed.tmpl | 13 ++++++++++++- templates/comment_post_spam.tmpl | 13 ++++++++++++- 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/controllers/blog.go b/controllers/blog.go index dcf9bcc..11ddc94 100644 --- a/controllers/blog.go +++ b/controllers/blog.go @@ -76,7 +76,7 @@ func RenderBlogPage(c *gin.Context) { func RenderIndividualBlogPost(c *gin.Context) { bp := GetBlogPostById(c.Param("url")) if bp == nil { - c.HTML(http.StatusNotFound, "not_found.tmpl", models.Page{Title: " | 404"}) + c.HTML(http.StatusNotFound, "not_found.tmpl", models.Page{Title: "404"}) } else { // Blog posts handle the title themselves c.HTML(http.StatusOK, "blog_post.tmpl", struct { diff --git a/templates/comment_post.tmpl b/templates/comment_post.tmpl index 84a6168..6e22141 100644 --- a/templates/comment_post.tmpl +++ b/templates/comment_post.tmpl @@ -1,4 +1,15 @@ -{{ template "header.tmpl" . }} + + + + + + + + + Comment success + + + {{ template "nav.tmpl" . }}

Your comment is being posted...

You will be redirected or, click here to return to the blog post.

diff --git a/templates/comment_post_failed.tmpl b/templates/comment_post_failed.tmpl index b651854..f43f493 100644 --- a/templates/comment_post_failed.tmpl +++ b/templates/comment_post_failed.tmpl @@ -1,4 +1,15 @@ -{{ template "header.tmpl" . }} + + + + + + + + + Comment failed + + + {{ template "nav.tmpl" . }}

Your comment failed to be posted...

You will be redirected or, click here to return to the blog post.

diff --git a/templates/comment_post_spam.tmpl b/templates/comment_post_spam.tmpl index b5ea891..cb5323d 100644 --- a/templates/comment_post_spam.tmpl +++ b/templates/comment_post_spam.tmpl @@ -1,4 +1,15 @@ -{{ template "header.tmpl" . }} + + + + + + + + + Comment spam + + + {{ template "nav.tmpl" . }}

You've commented too many times, too quickly. Your comment will not be posted.

Click here to return to the post.