summaryrefslogtreecommitdiff
path: root/components/actions_table.html
diff options
context:
space:
mode:
Diffstat (limited to 'components/actions_table.html')
-rw-r--r--components/actions_table.html17
1 files changed, 11 insertions, 6 deletions
diff --git a/components/actions_table.html b/components/actions_table.html
index f862906..8b151e5 100644
--- a/components/actions_table.html
+++ b/components/actions_table.html
@@ -1,12 +1,12 @@
{{define "UserScore"}}
<table id="usertable">
<tr>
- <th>ID</th>
+ <th>Username</th>
<th>BurnTime</th>
<th>Score</th>
</tr>
<tr>
- <td>{{.ID}}</td>
+ <td>{{.Username}}</td>
<td>{{.BurnTime}}</td>
<td>{{.Score}}</td>
</tr>
@@ -21,13 +21,15 @@
<th>Commit</th>
</tr>
{{range $action := .Actions}}
- {{if and (eq $action.Type "ActionTypePlus") (not $action.Done)}}
+ {{if and (eq $action.Type "ActionTypePlus") (or (not $action.Done) ($action.Repeatable))}}
+ <form hx-post="/done">
<tr>
- <td>{{$action.Name}}</td>
+ <td><input class="action_name" name="name" value={{$action.Name}} type="hidden" readonly />{{$action.Name}}</td>
<td>{{$action.Magnitude}}</td>
<td>{{$action.Repeatable}}</td>
- <td><button>Done it</button></td>
+ <td><input type="submit" value="Done It"></input></td>
</tr>
+ </form>
{{end}}
{{end}}
</table>
@@ -43,12 +45,15 @@
</tr>
{{range $action := .Actions}}
{{if eq $action.Type "ActionTypeMinus"}}
+ <form hx-post="/done">
<tr>
+ <td><input class="action_name" name="name" value={{$action.Name}} type="hidden" readonly />{{$action.Name}}</td>
<td>{{$action.Name}}</td>
<td>{{$action.Magnitude}}</td>
<td>{{$action.Repeatable}}</td>
- <td><button>Done it</button></td>
+ <td><input type="submit" value="Done It"></input></td>
</tr>
+ </form>
{{end}}
{{end}}
</table>