Fix page count and comment form styling

This commit is contained in:
Noah 2018-04-14 09:29:03 -07:00
父節點 92887a6472
當前提交 efeb2e934e
共有 2 個檔案被更改,包括 6 行新增5 行删除

查看文件

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

查看文件

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