func addHandler(rw http.ResponseWriter, req *http.Request) { type Page struct { PageName string Title string Concerts []concert.Concert Retailers []retailer.Retailer Now string } concerts := concert.FindAll() retailers := retailer.FindAll() t := time.Now() p := Page{ PageName: "ticket", Title: "Add Controller", Concerts: concerts, Retailers: retailers, Now: t.Format("2006-01-02 15:04:05"), } common.Templates = template.Must(template.ParseFiles("templates/ticket/add.html", common.LayoutPath)) err := common.Templates.ExecuteTemplate(rw, "base", p) common.CheckError(err) }
func addBandRecordToConcertHandler(rw http.ResponseWriter, req *http.Request) { type Page struct { PageName string Title string Concerts []concert.Concert } concerts := concert.FindAll() p := Page{ PageName: "admin_band", Title: "Add Controller", Concerts: concerts, } common.Templates = template.Must(template.ParseFiles("templates/band/addBandRecordToConcert.html", common.LayoutPath)) err := common.Templates.ExecuteTemplate(rw, "base", p) common.CheckError(err) }