summaryrefslogtreecommitdiff
path: root/components/actions_table.html
blob: f8629065d65fc483fb6c9341245cb83c67131485 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{{define "UserScore"}}
<table id="usertable">
  <tr>
    <th>ID</th>
    <th>BurnTime</th>
    <th>Score</th>
  </tr>
  <tr>
    <td>{{.ID}}</td>
    <td>{{.BurnTime}}</td>
    <td>{{.Score}}</td>
  </tr>
</table>
<div class="actiontable">
<p>ActionTypePlus</p>
<table>
  <tr>
    <th>Name</th>
    <th>Magnitude</th>
    <th>Repeatable</th>
    <th>Commit</th>
  </tr>
  {{range $action := .Actions}}
    {{if and (eq $action.Type "ActionTypePlus") (not $action.Done)}}
      <tr>
        <td>{{$action.Name}}</td>
        <td>{{$action.Magnitude}}</td>
        <td>{{$action.Repeatable}}</td>
        <td><button>Done it</button></td>
      </tr>
    {{end}}
  {{end}}
</table>
</div>
<div class="actiontable">
<p>ActionTypeMinus</p>
<table>
  <tr>
    <th>Name</th>
    <th>Magnitude</th>
    <th>Repeatable</th>
    <th>Commit</th>
  </tr>
  {{range $action := .Actions}}
    {{if eq $action.Type "ActionTypeMinus"}}
      <tr>
        <td>{{$action.Name}}</td>
        <td>{{$action.Magnitude}}</td>
        <td>{{$action.Repeatable}}</td>
        <td><button>Done it</button></td>
      </tr>
    {{end}}
  {{end}}
</table>
</div>
{{end}}