From 742993249d98550cce3059fac9a81792c5f53bed Mon Sep 17 00:00:00 2001
From: Jordan
Date: Sun, 19 Dec 2021 00:57:33 -0700
Subject: web: housekeeping
---
web.go | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/web.go b/web.go
index 404ad6b..74ace47 100644
--- a/web.go
+++ b/web.go
@@ -22,12 +22,12 @@ type Resp struct {
var funcMap = template.FuncMap{
"add": add,
- "minus": minus,
+ "subtract": subtract,
"setQuery": setQuery,
"intToStr": intToStr,
}
-const i = `
+const index = `
@@ -102,7 +102,7 @@ const i = `
{{- if gt .Offset 0 -}}
-
Previous
+
Previous
{{- end -}}
Home
{{- if ge (len .Entries) 100 -}}
@@ -131,7 +131,7 @@ const i = `
{{- if gt .Offset 0 -}}
-
Previous
+
Previous
{{- end -}}
Home
{{- if ge (len .Entries) 100 -}}
@@ -142,16 +142,16 @@ const i = `
`
-var t = template.Must(template.New("").Funcs(funcMap).Parse(i))
+var indexTmp = template.Must(template.New("").Funcs(funcMap).Parse(index))
-func minus(a int, b int) int {
+func add(a int, b int) int {
- return a - b
+ return a + b
}
-func add(a int, b int) int {
+func subtract(a int, b int) int {
- return a + b
+ return a - b
}
func intToStr(a int) string {
@@ -179,7 +179,7 @@ func (db *SqliteDB) IndexHandler(w http.ResponseWriter, r *http.Request) {
resp.Stats, resp.Err = db.Stats()
if resp.Err != nil {
log.Println(resp.Err)
- t.Execute(w, &resp)
+ indexTmp.Execute(w, &resp)
return
}
@@ -200,5 +200,5 @@ func (db *SqliteDB) IndexHandler(w http.ResponseWriter, r *http.Request) {
if resp.Err != nil {
log.Println(resp.Err)
}
- t.Execute(w, &resp)
+ indexTmp.Execute(w, &resp)
}
--
cgit v1.2.3-54-g00ecf