diff options
author | Julian T <julian@jtle.dk> | 2024-05-26 22:20:40 +0200 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2024-05-29 22:25:47 +0200 |
commit | afb0a04fe600575b00d551da7dce6a08679ef7b8 (patch) | |
tree | 8f90720887cf49045d65a9d17dad984dae06275c /templates/index.html | |
parent | 9b55b16f3b906958171b4f45002b58d5f77b9705 (diff) |
Diffstat (limited to 'templates/index.html')
-rw-r--r-- | templates/index.html | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/templates/index.html b/templates/index.html index 18ca5f0..99bfc31 100644 --- a/templates/index.html +++ b/templates/index.html @@ -8,6 +8,7 @@ <!-- TODO REMOVE --> <script src="https://unpkg.com/htmx.org@1.9.12/dist/htmx.js" integrity="sha384-qbtR4rS9RrUMECUWDWM2+YGgN3U4V4ZncZ0BvUcg9FGct0jqXz3PUdVpU1p0yrXS" crossorigin="anonymous"></script> + <script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/response-targets.js"></script> <style> .flex { @@ -73,16 +74,22 @@ padding: 10px; max-width: 500px; } + +#error-box { + color: red; + font-weight: bold; +} </style> </head> - <body> + <body hx-ext="response-targets"> <div id="controls-bar"> <button hx-get="/" hx-replace-url="true" hx-params="date" hx-vals='{"date": "{{.DateInfo.Yesterday}}"}' hx-target="body">I går</button> <input type="date" hx-get="/" hx-replace-url="true" hx-params="date" hx-vals='js:{date: event.target.value}' autocomplete="off" hx-target="body" hx-trigger="change" value="{{.DateInfo.Date}}" /> <button hx-get="/" hx-replace-url="true" hx-params="date" hx-vals='{"date": "{{.DateInfo.Tomorrow}}"}' hx-target="body">I morgen</button> + <div id="error-box"></div> </div> - <div class="flex"> + <div class="flex" hx-target-*="#error-box"> <div id="entry-bar"> {{template "entry.html" .Entry}} <div> @@ -120,7 +127,7 @@ </select> </form> {{ template "task.html" .Task }} - {{ template "taskRows.html" . }} + {{ template "taskRows.html" .Tasks }} </div> </div> </body> |