summaryrefslogtreecommitdiff
path: root/templates/parts/entry.html
diff options
context:
space:
mode:
authorJulian Jørgensen <julian@jtle.dk>2024-05-24 21:30:23 +0200
committerJulian Jørgensen <julian@jtle.dk>2024-05-24 21:30:23 +0200
commit2f83424ce8a0653e6e158318df1511daecf1a42d (patch)
treeb29c1b5c8df940873521d013697209195956151e /templates/parts/entry.html
parent19f8454a680c5231df68fee36ed9758587df316c (diff)
Time format rework
Diffstat (limited to 'templates/parts/entry.html')
-rw-r--r--templates/parts/entry.html20
1 files changed, 10 insertions, 10 deletions
diff --git a/templates/parts/entry.html b/templates/parts/entry.html
index f99fb90..9f05ffa 100644
--- a/templates/parts/entry.html
+++ b/templates/parts/entry.html
@@ -1,18 +1,18 @@
-<form id="entry-bar" autocomplete="off" class="status-{{if .Detached}}detached{{else}}{{if .Task}}started{{else}}stopped{{end}}{{end}}">
- <input style="display: none;" value="{{ if .Task }}{{ .Task.Id }}{{end}}" type="text" name="id" />
+<form id="entry-bar" autocomplete="off" class="status-{{if .Detached}}detached{{else}}{{if .Entry}}started{{else}}stopped{{end}}{{end}}">
+ <input style="display: none;" value="{{ if .Entry }}{{ .Entry.Id }}{{end}}" type="text" name="id" />
{{ if .Detached }}
- <span>{{ if gt .Task.Id -1 }}Redigerer opgave {{ .Task.Id }}{{else}}Redigerer ny opgave{{end}}{{ if .Tracking }}, med opgave i baggrunden!{{else}}.{{end}}</span><br>
+ <span>{{ if gt .Entry.Id -1 }}Redigerer opgave {{ .Entry.Id }}{{else}}Redigerer ny opgave{{end}}{{ if .Tracking }}, med opgave i baggrunden!{{else}}.{{end}}</span><br>
{{end}}
<div class="flex just-start">
<div class="entry-box">
<b>Interval</b>
<div>
<label for="fromTime">Fra: </label>
- <input name="from" id="fromTime" type="time" class="form-control" {{if .Task}}value="{{formatTime .Task.From}}" required{{end}} aria-label="Time start">
+ <input name="from" id="fromTime" type="time" class="form-control" {{if .Entry}}value="{{.Entry.From}}" required{{end}} aria-label="Time start">
</div>
<div>
<label for="toTime">Til: </label>
- <input name="to" id="toTime" type="time" class="form-control" {{if not .Detached}}disabled{{end}} aria-label="Time stop">
+ <input name="to" id="toTime" type="time" class="form-control" {{if .Entry}}value="{{if .Entry.To}}{{.Entry.To}}{{end}}" required{{end}} {{if not .Detached}}disabled{{end}} aria-label="Time stop">
</div>
</div>
<div class="entry-box">
@@ -30,16 +30,16 @@
</div>
<div class="entry-box">
<b>Kommentar</b><br>
- <textarea name="comment">{{if .Task}}{{.Task.Comment}}{{end}}</textarea>
+ <textarea name="comment">{{if .Entry}}{{.Entry.Comment}}{{end}}</textarea>
</div>
<div class="entry-box">
<b>Status</b><br>
- {{ if not .Detached}}<i>{{ if .Task }}I gang{{ else }}Stoppet{{ end }}</i><br>{{end}}
- {{ if .Task }}<span>1:34 timer</span>{{ end }}
+ {{ if not .Detached}}<i>{{ if .Entry }}I gang{{ else }}Stoppet{{ end }}</i><br>{{end}}
+ {{ if .Entry }}<span>1:34 timer</span>{{ end }}
</div>
</div>
- {{ if .Task }}
+ {{ if .Entry }}
<button
hx-put="/save{{if .Detached}}?detached=true{{end}}"
hx-trigger="click"
@@ -56,7 +56,7 @@
hx-swap="outerHTML"
>Tilbage</button>
{{ else }}
- {{ if .Task }}
+ {{ if .Entry }}
<button
hx-post="/stop"
hx-trigger="click"