Refactor template loading around the handler

This commit is contained in:
Las Zenow 2017-06-06 14:18:47 +00:00
parent d40dc21627
commit 5517da6a69
9 changed files with 40 additions and 42 deletions

View file

@ -73,7 +73,7 @@ func editHandler(h handler) {
author = " by " + book.Authors[0]
}
data.S.Title = book.Title + author + " -- Edit -- " + data.S.Title
h.template.load(h, "edit", data)
h.load("edit", data)
}
func cleanEmptyStr(s []string) []string {
@ -185,7 +185,7 @@ func newHandler(h handler) {
data.Prev = "/new/?q=" + req + "&p=" + strconv.Itoa(page-1)
}
data.Search = req
h.template.load(h, "new", data)
h.load("new", data)
}
func storeHandler(h handler) {