Fix page count and comment form styling
This commit is contained in:
parent
92887a6472
commit
efeb2e934e
|
@ -4,6 +4,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"html/template"
|
"html/template"
|
||||||
|
"math"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
@ -33,7 +34,7 @@ func partialIndex(r *http.Request, tag, privacy string) template.HTML {
|
||||||
stop := offset + perPage
|
stop := offset + perPage
|
||||||
|
|
||||||
// Calculate page total.
|
// Calculate page total.
|
||||||
var pages = int(len(pool) / perPage)
|
var pages = math.Ceil(float64(len(pool)) / float64(perPage))
|
||||||
if pages == 0 {
|
if pages == 0 {
|
||||||
pages = 1
|
pages = 1
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,8 +55,8 @@
|
||||||
{{ define "comment-form" }}
|
{{ define "comment-form" }}
|
||||||
{{ if not .IsAuthenticated }}
|
{{ if not .IsAuthenticated }}
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="name" class="col-2 col-form-label">Your name:</label>
|
<label for="name" class="col-12 col-lg-2 col-form-label">Your name:</label>
|
||||||
<div class="col-10">
|
<div class="col-12 col-lg-10">
|
||||||
<input type="text"
|
<input type="text"
|
||||||
id="name"
|
id="name"
|
||||||
name="name"
|
name="name"
|
||||||
|
@ -67,8 +67,8 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="email" class="col-2 col-form-label">Your email:</label>
|
<label for="email" class="col-12 col-lg-2 col-form-label">Your email:</label>
|
||||||
<div class="col-10">
|
<div class="col-12 col-lg-10">
|
||||||
<input type="email"
|
<input type="email"
|
||||||
id="email"
|
id="email"
|
||||||
name="email"
|
name="email"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user