Fix page count and comment form styling

pull/5/head
Noah 2018-04-14 09:29:03 -07:00
parent 92887a6472
commit efeb2e934e
2 changed files with 6 additions and 5 deletions

View File

@ -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
}

View File

@ -55,8 +55,8 @@
{{ define "comment-form" }}
{{ if not .IsAuthenticated }}
<div class="form-group row">
<label for="name" class="col-2 col-form-label">Your name:</label>
<div class="col-10">
<label for="name" class="col-12 col-lg-2 col-form-label">Your name:</label>
<div class="col-12 col-lg-10">
<input type="text"
id="name"
name="name"
@ -67,8 +67,8 @@
</div>
<div class="form-group row">
<label for="email" class="col-2 col-form-label">Your email:</label>
<div class="col-10">
<label for="email" class="col-12 col-lg-2 col-form-label">Your email:</label>
<div class="col-12 col-lg-10">
<input type="email"
id="email"
name="email"