summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-04-07 11:56:20 +0200
committerxengineering <me@xengineering.eu>2024-05-12 20:52:25 +0200
commit01d97189d245300d65ca31d650dd868d1d1fc0d8 (patch)
treed1d5deacad3a605c78cd095ceadcb468ec86ebc4
parent87ae71413e47ef34da57bc1e0b8dddbf84b0c66a (diff)
downloadceres-01d97189d245300d65ca31d650dd868d1d1fc0d8.tar
ceres-01d97189d245300d65ca31d650dd868d1d1fc0d8.tar.zst
ceres-01d97189d245300d65ca31d650dd868d1d1fc0d8.zip
view: Show ingredients on read page
-rw-r--r--model/recipe.go1
-rw-r--r--view/html/recipe.html1
2 files changed, 2 insertions, 0 deletions
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" }}