Exemple #1
0
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)
	}
}
Exemple #2
0
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"})
	}
}
Exemple #3
0
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)
	}
}
Exemple #4
0
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})
	}
}