Example #1
0
func Index(w http.ResponseWriter, r *http.Request, p config.Page) {
	data := indexData{
		Drinks:    database.GetDrinks(),
		Cocktails: database.GetCocktail(),
	}

	pi := config.NewPageInfo(p.Id, "Cocktails", "index.html", data)

	templates.RenderPage(w, pi)
}
Example #2
0
func NewCocktailForm(w http.ResponseWriter, r *http.Request, p config.Page) {
	fi := config.NewFormInfo(p.Id, "new-cocktail.html", database.GetDrinks())

	templates.RenderForm(w, fi)
}