diff --git a/internal/controllers/posts/index.go b/internal/controllers/posts/index.go index 1148f61..4f869d0 100644 --- a/internal/controllers/posts/index.go +++ b/internal/controllers/posts/index.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "html/template" + "math" "net/http" "strconv" @@ -33,7 +34,7 @@ func partialIndex(r *http.Request, tag, privacy string) template.HTML { stop := offset + perPage // Calculate page total. - var pages = int(len(pool) / perPage) + var pages = math.Ceil(float64(len(pool)) / float64(perPage)) if pages == 0 { pages = 1 } diff --git a/root/comments/entry.partial.gohtml b/root/comments/entry.partial.gohtml index 05cf2da..51e1fa1 100644 --- a/root/comments/entry.partial.gohtml +++ b/root/comments/entry.partial.gohtml @@ -55,8 +55,8 @@ {{ define "comment-form" }} {{ if not .IsAuthenticated }}
- -
+ +
- -
+ +