2022-03-12 18:06:39 +00:00
|
|
|
// package controllers
|
2022-02-23 12:07:09 +00:00
|
|
|
|
2022-03-12 18:06:39 +00:00
|
|
|
// import (
|
|
|
|
// "html/template"
|
|
|
|
// "net/http"
|
2022-02-23 12:07:09 +00:00
|
|
|
|
2022-03-12 18:06:39 +00:00
|
|
|
// "git.technical.kiwi/go/otfe/misc/helpers"
|
|
|
|
// "github.com/globalsign/mgo/bson"
|
|
|
|
// )
|
2022-02-23 12:07:09 +00:00
|
|
|
|
2022-03-12 18:06:39 +00:00
|
|
|
// /*type Controller interface {
|
|
|
|
// Index(w http.ResponseWriter, r *http.Request)
|
|
|
|
// Show(w http.ResponseWriter, r *http.Request)
|
|
|
|
// New(w http.ResponseWriter, r *http.Request)
|
|
|
|
// Create(w http.ResponseWriter, r *http.Request)
|
|
|
|
// Edit(w http.ResponseWriter, r *http.Request)
|
|
|
|
// Update(w http.ResponseWriter, r *http.Request)
|
|
|
|
// Delete(w http.ResponseWriter, r *http.Request)
|
|
|
|
// }*/
|
2022-02-23 12:07:09 +00:00
|
|
|
|
2022-03-12 18:06:39 +00:00
|
|
|
// var funcMap = template.FuncMap{
|
|
|
|
// "getId": func(id bson.ObjectId) string {
|
|
|
|
// return "1"
|
|
|
|
// },
|
|
|
|
// }
|
2022-02-23 12:07:09 +00:00
|
|
|
|
2022-03-12 18:06:39 +00:00
|
|
|
// func t(w http.ResponseWriter, data interface{}, layout string) {
|
|
|
|
// views := helpers.GetRootDir() + "/views/"
|
|
|
|
// tmpl := template.Must(template.New("layout").Funcs(funcMap).
|
|
|
|
// ParseFiles(views+"/layouts/layout.gtpl", views+"/layouts/header.gtpl", views+"/layouts/footer.gtpl", views+"/layouts/nav.gtpl", views+layout))
|
|
|
|
// tmpl.ExecuteTemplate(w, "layout", data)
|
2022-02-23 12:07:09 +00:00
|
|
|
|
2022-03-12 18:06:39 +00:00
|
|
|
// }
|