| 1 | <!doctype html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8" /> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 6 | <meta name="theme-color" content="#121113" /> |
| 7 | <link rel="stylesheet" href="/assets/darkmatter.css" /> |
| 8 | <link rel="stylesheet" href="/static/styles.css" /> |
| 9 | <title>Habbits | New habit</title> |
| 10 | </head> |
| 11 | <body> |
| 12 | <div class="header"> |
| 13 | <a href="/" class="logo">HABBITS</a> |
| 14 | <nav class="links"> |
| 15 | <a href="/">dashboard</a> |
| 16 | <a href="/settings">settings</a> |
| 17 | <a href="/logout">logout</a> |
| 18 | </nav> |
| 19 | </div> |
| 20 | |
| 21 | {{if .Error}}<p class="error">{{.Error}}</p>{{end}} |
| 22 | |
| 23 | <section class="section"> |
| 24 | <h2>New habit</h2> |
| 25 | <form class="form" method="POST" action="/habits"> |
| 26 | <div class="form-row"> |
| 27 | <div class="form-field"> |
| 28 | <label for="name">Name</label> |
| 29 | <input type="text" id="name" name="name" placeholder="e.g. Sleep" required autofocus /> |
| 30 | </div> |
| 31 | <div class="form-field"> |
| 32 | <label for="value_type">Value type</label> |
| 33 | <select id="value_type" name="value_type" required> |
| 34 | {{range .ValueTypes}}<option value="{{.}}">{{.}}</option>{{end}} |
| 35 | </select> |
| 36 | </div> |
| 37 | <div class="form-field"> |
| 38 | <label for="unit">Unit</label> |
| 39 | <input type="text" id="unit" name="unit" placeholder="hrs, kg… (optional)" /> |
| 40 | </div> |
| 41 | </div> |
| 42 | <div class="form-field"> |
| 43 | <label for="description">Description</label> |
| 44 | <input type="text" id="description" name="description" placeholder="optional" /> |
| 45 | </div> |
| 46 | <div class="form-actions"> |
| 47 | <button type="submit">Create habit</button> |
| 48 | </div> |
| 49 | </form> |
| 50 | </section> |
| 51 | </body> |
| 52 | </html> |