From 01d97189d245300d65ca31d650dd868d1d1fc0d8 Mon Sep 17 00:00:00 2001
From: xengineering <me@xengineering.eu>
Date: Sun, 7 Apr 2024 11:56:20 +0200
Subject: view: Show ingredients on read page

---
 model/recipe.go       | 1 +
 view/html/recipe.html | 1 +
 2 files changed, 2 insertions(+)

diff --git a/model/recipe.go b/model/recipe.go
index 59a4c4a..7f8a1d5 100644
--- a/model/recipe.go
+++ b/model/recipe.go
@@ -260,6 +260,7 @@ func RecipeTestData() []Recipe {
 						{Amount: "4", Unit: "pieces", Type: "egg"},
 						{Amount: "800", Unit: "g", Type: "special stuff"},
 						{Amount: "0.5", Unit: "l", Type: "milk"},
+						{Amount: "", Unit: "", Type: "salt"},
 					},
 				},
 				{Text: "Heat up pan", Ingredients: []Ingredient{}},
diff --git a/view/html/recipe.html b/view/html/recipe.html
index fea32a5..3d9ab63 100644
--- a/view/html/recipe.html
+++ b/view/html/recipe.html
@@ -17,6 +17,7 @@
 			<p class="notice" style="white-space: pre-line;">{{.Notes}}</p>{{end}}{{range .Steps}}
 			<section>
 				<p>{{.Text}}</p>
+				<p><i>{{range $i, $el := .Ingredients}}{{if $i}}, {{end}}{{if ne $el.Amount ""}}{{$el.Amount}} {{end}}{{if ne $el.Unit ""}}{{$el.Unit}} {{end}}{{$el.Type}}{{end}}</i></p>
 			</section>{{end}}
 		</main>
 		{{ template "footer" }}
-- 
cgit v1.2.3-70-g09d2