Пример #1
0
func HomeGenreList(r http.ResponseWriter, rw *http.Request) {
	genres := models.GetAll(tiedotmartini2.GENRE_COL)
	t, err := template.ParseFiles("src/tiedotmartini2/views/home/genrelist.html")
	if err != nil {
		panic(err)
	}
	t.Execute(r, struct {
		Title  string
		Genres []models.DocWithID
	}{Title: "List of Genres", Genres: genres})
}
Пример #2
0
func HomeIndex(r http.ResponseWriter, rw *http.Request) {
	bands := models.GetAll(tiedotmartini2.BAND_COL)
	t, err := template.ParseFiles("src/tiedotmartini2/views/home/index.html")
	if err != nil {
		panic(err)
	}
	t.Execute(r, struct {
		Title string
		Bands []models.DocWithID
	}{Title: "My CD Catalog", Bands: bands})
}
Пример #3
0
func BandAdd(r http.ResponseWriter, rq *http.Request) {
	locations := models.GetAll(tiedotmartini2.LOCATION_COL)
	t, err := template.ParseFiles("src/tiedotmartini2/views/band/add.html")
	if err != nil {
		panic(err)
	} else {
		t.Execute(r, struct {
			Title     string
			Locations []models.DocWithID
		}{Title: "Adding A Band", Locations: locations})
	}
}