ictgj-voting/public_endpoints.go

31 lines
514 B
Go
Raw Normal View History

2017-04-03 21:32:13 +00:00
package main
import (
"fmt"
"net/http"
)
func initPublicPage(w http.ResponseWriter, req *http.Request) *pageData {
2017-04-21 18:17:18 +00:00
p := InitPageData(w, req)
2017-06-08 17:20:43 +00:00
2017-04-03 21:32:13 +00:00
return p
}
func handleMain(w http.ResponseWriter, req *http.Request) {
page := initPublicPage(w, req)
2017-06-08 17:20:43 +00:00
page.SubTitle = ""
2017-04-03 21:32:13 +00:00
for _, tmpl := range []string{
"htmlheader.html",
2017-06-08 17:20:43 +00:00
"admin-menu.html",
"header.html",
2017-04-03 21:32:13 +00:00
"main.html",
"footer.html",
"htmlfooter.html",
} {
if err := outputTemplate(tmpl, page, w); err != nil {
fmt.Printf("%s\n", err)
}
}
}