From 0c2e35bb80e03d453ea2e50e4f18e52ee07ea79b Mon Sep 17 00:00:00 2001 From: Las Zenow Date: Mon, 9 Apr 2018 19:14:11 +0000 Subject: [PATCH] Fix the typeahead --- lib/template.go | 5 ++++- templates/book.html | 10 ++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/template.go b/lib/template.go index 16a837a..f3dc6ff 100644 --- a/lib/template.go +++ b/lib/template.go @@ -10,6 +10,7 @@ import ( "errors" "net/http" "path" + "strings" "time" "gitlab.com/trantor/trantor/lib/database" @@ -57,7 +58,9 @@ func InitTemplate(assetsPath string) *Template { var t Template templatePath := path.Join(assetsPath, "templates") - t.html, err = html_tmpl.ParseGlob(path.Join(templatePath, "*.html")) + t.html, err = html_tmpl.New("html").Funcs(html_tmpl.FuncMap{ + "strings_join": strings.Join, + }).ParseGlob(path.Join(templatePath, "*.html")) if err != nil { log.Critical("Error loading html templates: ", err) } diff --git a/templates/book.html b/templates/book.html index b70217c..1aa68e3 100644 --- a/templates/book.html +++ b/templates/book.html @@ -100,17 +100,11 @@ function delBook(){
- - + +
- - {{end}} {{template "footer.html"}}