diff options
author | GrailFinder <wohilas@gmail.com> | 2024-04-07 09:53:04 +0300 |
---|---|---|
committer | GrailFinder <wohilas@gmail.com> | 2024-04-07 09:53:04 +0300 |
commit | 4a42a4465c8ff5496229f8883b9d1532bf7c9cab (patch) | |
tree | e0cbccdfe6a770cbbdecee2e2176ee697997229e /components | |
parent | b662265234d70d648a7adce74f3d9cc245456d3a (diff) |
Feat: db connection and migrations
Diffstat (limited to 'components')
-rw-r--r-- | components/actions_table.html | 17 |
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> |