summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/add_action_form.html18
-rw-r--r--components/index.html32
2 files changed, 19 insertions, 31 deletions
diff --git a/components/add_action_form.html b/components/add_action_form.html
new file mode 100644
index 0000000..70403dc
--- /dev/null
+++ b/components/add_action_form.html
@@ -0,0 +1,18 @@
+{{define "actionform"}}
+<div id="actionform">
+ <h1>Add action</h1>
+ <form method="POST">
+ <label>Name:</label><br />
+ <input type="text" name="name"><br />
+ <label>Magnitude:</label><br />
+ <input type="number" value="1" name="magnitude"><br />
+ <label>Repeatable:</label><br />
+ <input type="checkbox" name="repeatable"></input><br />
+ <input type="radio" name="act_type" value="plus" checked>
+ <label for="plus">Plus</label>
+ <input type="radio" name="act_type" value="minus">
+ <label for="minus">Minus</label><br>
+ <input type="submit">
+ </form>
+</div>
+{{end}}
diff --git a/components/index.html b/components/index.html
index d32154a..6848f1a 100644
--- a/components/index.html
+++ b/components/index.html
@@ -11,40 +11,10 @@
<div id="ancestor">
<hr />
<div>
- HELLO {{.ID}}
- <br />
- <!-- You have {{len .Actions}} actions. -->
- <!-- <br /> -->
- <!-- Your current score: {{.Score}} -->
- <!-- <br /> -->
- <!-- {{ range .Actions }} -->
- <!-- Action Name: {{.Name}} -->
- <!-- <br /> -->
- <!-- Action Magnitude: {{.Magnitude}} -->
- <!-- <br /> -->
- <!-- Action Type: {{.Type}} -->
- <!-- <br /> -->
- <!-- Repeatable: {{.Repeatable}} -->
- <!-- <br /> -->
- <!-- {{end}} -->
{{ template "UserScore" . }}
</div>
-
<div>
- <h1>Add action</h1>
- <form method="POST">
- <label>Name:</label><br />
- <input type="text" name="name"><br />
- <label>Magnitude:</label><br />
- <input type="number" value="1" name="magnitude"><br />
- <label>Repeatable:</label><br />
- <input type="checkbox" name="repeatable"></input><br />
- <input type="radio" name="act_type" value="plus" checked>
- <label for="plus">Plus</label>
- <input type="radio" name="act_type" value="minus">
- <label for="minus">Minus</label><br>
- <input type="submit">
- </form>
+ {{ template "actionform" }}
</div>
</div>
</body>