templates/new.tmpl (view raw)
1{{ extends "base.tmpl" }}
2
3{{define "title" -}}New habit{{end}}
4
5{{define "content" -}}
6 <h1>New habit</h1>
7 <h4>
8 {{ if .Negative }}
9 Which negative habit are you trying to stop?
10 {{ else }}
11 Which positive habit are you trying to get?<br />
12 How often would you like to do it?
13 {{ end }}
14 </h4>
15
16 <form method="post" action="/new">
17 <label>
18 <span>Name:</span>
19 <input type="text" name="name" autocomplete="off" placeholder="Name" required />
20 </label>
21 {{ if .Negative }}
22 <input type="hidden" name="negative" value="on" />
23 {{ else }}
24 <label>
25 <span>Days:</span>
26 <input type="number" name="days" autocomplete="off" placeholder="Days" min="1" max="60" required />
27 </label>
28 {{ end }}
29 <input type="submit" value="Create" />
30 </form>
31{{end}}