templates/habits-id.tmpl (view raw)
1{{ extends "base.tmpl" }}
2
3{{define "title" -}}Edit - {{end}}
4
5{{define "content" -}}
6 <h1>Edit habit</h1>
7 <a href="/habits">← Back</a>
8
9 <form method="post" action="/habits/{{ .ID }}">
10 <label>
11 <span>Name:</span>
12 <input type="text" name="name" autocomplete="off" placeholder="Name" value="{{ .Name }}" required />
13 </label>
14 {{ if not .Negative }}
15 <label>
16 <span>Days:</span>
17 <input type="number" name="days" autocomplete="off" placeholder="Days" min="1" max="60" value="{{ .Days }}" required />
18 </label>
19 <label>
20 <span>Enabled:</span>
21 <input type="checkbox" name="enabled"{{ if not .Disabled }} checked{{ end }} />
22 </label>
23 {{ end }}
24 <input type="submit" value="Save" class="spaced" />
25 </form>
26 <form method="post" action="/delete/{{ .ID }}">
27 <input type="submit" value="Delete" class="spaced" />
28 </form>
29{{end}}