Templates are working, just empty

This commit is contained in:
2017-10-05 00:08:07 +02:00
parent 525fbb4f94
commit 8c8aad3312
9 changed files with 133 additions and 27 deletions
+9 -2
View File
@@ -2,6 +2,10 @@ package controllers
import (
"net/http"
"strings"
"git.aiterp.net/AiteRP/aitestory/view"
"git.aiterp.net/AiteRP/aitestory/viewmodel"
"git.aiterp.net/gisle/wrouter"
"git.aiterp.net/gisle/wrouter/auth"
@@ -11,11 +15,14 @@ import (
var ListController = wrouter.Router{}
func listIndex(path string, w http.ResponseWriter, req *http.Request, user *auth.User) bool {
if req.Method != "GET" {
if req.Method != "GET" || strings.LastIndex(req.URL.Path, "/") >= len(path) {
return false
}
// tags := strings.Split(path, ",")
vm := viewmodel.PageList{}
vm.Setup(user)
view.Render(w, "index", 200, vm)
return true
}