summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-03-06 20:53:38 +0100
committerxengineering <me@xengineering.eu>2024-03-06 21:42:44 +0100
commit06293b48bb1288348e36dceb779cc06f31b0ba8d (patch)
tree48a63de5000ef4971e55261ce0bc448a0d3e510f
parentf10765778208840e4dd675646041305ad6b17861 (diff)
downloadceres-06293b48bb1288348e36dceb779cc06f31b0ba8d.tar
ceres-06293b48bb1288348e36dceb779cc06f31b0ba8d.tar.zst
ceres-06293b48bb1288348e36dceb779cc06f31b0ba8d.zip
view: Display message in case of no recipes
-rw-r--r--view/html/recipes.html7
1 files changed, 4 insertions, 3 deletions
diff --git a/view/html/recipes.html b/view/html/recipes.html
index dc072a1..c0a0719 100644
--- a/view/html/recipes.html
+++ b/view/html/recipes.html
@@ -8,12 +8,13 @@
</header>
<body>
<main>
- <p>Here are the available recipes 😋🍳🍔🍕🥘</p>
+ <p><button onclick="create('/recipe')">create</button></p>
+{{if ne (len .) 0}}
<p><input id="search" onkeyup="filter()" type="text" placeholder="Search for a recipe ..."></p>
- <button onclick="create('/recipe')">add</button>
<ul id="recipes">{{range .}}
<li><a href="./recipe/{{.Id}}">{{.Title}}</a></li>{{end}}
- </ul>
+ </ul>{{else}}
+ <p><i>No recipes available.</i></p>{{end}}
</main>
{{ template "footer" }}
<script src="/static/view/static/ceres.js"></script>