all repos — well-binge @ main

Create positive, recurring habits.

templates/new.tmpl (view raw)

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