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) }
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) }