diff options
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> |