The backend for the AiteStory website
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
737 B

package controllers
import (
"net/http"
"git.aiterp.net/AiteRP/aitestory/view"
"git.aiterp.net/AiteRP/aitestory/viewmodel"
"git.aiterp.net/AiteRP/aitestory/model"
"git.aiterp.net/gisle/wrouter"
"git.aiterp.net/gisle/wrouter/auth"
)
// TagController serves and handles the tag managment pages
var TagController = wrouter.Router{}
func tagList(path string, w http.ResponseWriter, req *http.Request, user *auth.User) bool {
//var err error
if (req.Method != "GET" && req.Method != "POST") || len(req.URL.Path) > len(path) {
return false
}
tl := viewmodel.TagList{}
tl.Tags, _ = model.ListTags()
tl.Setup(user)
view.Render(w, "tags/list", 200, tl)
return true
}
func init() {
TagController.Function("/", tagList)
}