refactor templates

This commit is contained in:
sentriz
2019-06-24 21:40:48 +01:00
parent 4ed144da84
commit 58a4558d5b
11 changed files with 748 additions and 2208 deletions

View File

@@ -1,8 +1,8 @@
package handler
import (
"fmt"
"html/template"
"log"
"net/http"
"github.com/gorilla/sessions"
@@ -38,7 +38,8 @@ func renderTemplate(w http.ResponseWriter, r *http.Request,
}
err := tmpl.Execute(w, data)
if err != nil {
http.Error(w, fmt.Sprintf("500 when executing: %v", err), 500)
log.Println("error executing template: %v\n", err)
http.Redirect(w, r, "/", 500)
return
}
}