func BandAdd(r http.ResponseWriter, rq *http.Request) { locations := gomgoweb2_src.GetAll(gomgoweb2_src.LOCATION_COL) t, err := template.ParseFiles("src/gomgoweb2_src/views/band/add.html") if err != nil { panic(err) } else { t.Execute(r, locations) } }
func HomeIndex(r http.ResponseWriter, rq *http.Request) { docs := gomgoweb2_src.GetAll(gomgoweb2_src.BAND_COL) t, err := template.ParseFiles("src/gomgoweb2_src/views/home/index.html") if err != nil { panic(err) } else { t.Execute(r, Params{Bands: docs, Title: "My CD Catalog"}) } }
func GenreList(r http.ResponseWriter, rq *http.Request) { genres := gomgoweb2_src.GetAll(gomgoweb2_src.GENRE_COL) t, err := template.ParseFiles("src/gomgoweb2_src/views/home/genrelist.html") if err != nil { panic(err) } else { t.Execute(r, genres) } }
func AlbumAdd(r http.ResponseWriter, rq *http.Request) { value := rq.URL.Query() id := value["id"][0] genres := gomgoweb2_src.GetAll(gomgoweb2_src.GENRE_COL) t, err := template.ParseFiles("src/gomgoweb2_src/views/album/add.html") if err != nil { panic(err) } else { t.Execute(r, struct { Id string Genres []gomgoweb2_src.MyDoc }{Id: id, Genres: genres}) } }