package handlers import ( "html/template" "mealprep/database" "net/http" ) // GroceryListHandler handles the grocery list page func GroceryListHandler(w http.ResponseWriter, r *http.Request) { groceryItems, err := database.GetGroceryList() if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } tmpl := `
This list is automatically generated from your week plan.
{{if .Items}}No items in your grocery list. Add meals to your week plan to generate a grocery list.
{{end}}