diff options
author | xengineering <me@xengineering.eu> | 2024-03-06 19:17:07 +0100 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2024-03-06 19:30:24 +0100 |
commit | f10765778208840e4dd675646041305ad6b17861 (patch) | |
tree | 2facaf143d1e81f23382cb9268be403edd944a31 | |
parent | a1edb7fa63dd290654884eeabf89acc9e5965ae5 (diff) | |
download | ceres-f10765778208840e4dd675646041305ad6b17861.tar ceres-f10765778208840e4dd675646041305ad6b17861.tar.zst ceres-f10765778208840e4dd675646041305ad6b17861.zip |
view: Make recipe portions, URL and notes optional
An empty string for one of these attributes will lead to a recipe view
page which does not render the paragraph for this item.
-rw-r--r-- | view/html/recipe.html | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/view/html/recipe.html b/view/html/recipe.html index bce4ffa..356abda 100644 --- a/view/html/recipe.html +++ b/view/html/recipe.html @@ -7,10 +7,10 @@ <h1>{{.Title}}</h1> </header> <body> - <main> - <p>Portions: {{.Portions}}</p> - <p><a href="{{.Url}}">original recipe</a></p> - <p>{{.Notes}}</p> + <main>{{ if ne .Portions "" }} + <p>Portions: {{.Portions}}</p>{{end}}{{ if ne .Url "" }} + <p><a href="{{.Url}}">original recipe</a></p>{{end}}{{ if ne .Notes "" }} + <p>{{.Notes}}</p>{{end}} <a href="/recipe/{{.Id}}?view=recipe-edit"><button>edit</button></a> <a href="/recipe/{{.Id}}?view=recipe-confirm-deletion"><button style="background-color:red">delete</button></a> </main> |