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
8 <form method="post" action="/habits/{{ .ID }}">
9 <label>
10 <span>Name:</span>
11 <input type="text" name="name" autocomplete="off" placeholder="Name" value="{{ .Name }}" required />
12 </label>
13 {{ if not .Negative }}
14 <label>
15 <span>Days:</span>
16 <input type="number" name="days" autocomplete="off" placeholder="Days" min="1" max="60" value="{{ .Days }}" required />
17 </label>
18 <label>
19 <span>Enabled:</span>
20 <input type="checkbox" name="enabled"{{ if not .Disabled }} checked{{ end }} />
21 </label>
22 {{ end }}
23 <input type="submit" value="Save" />
24 </form>
25 <form method="post" action="/delete/{{ .ID }}">
26 <input type="submit" value="Delete" />
27 </form>
28{{end}}