allowances/templates/index.html

46 lines
2.1 KiB
HTML

{{ define "title" }}Welcome{{ end }}
{{ define "content" }}
<div class="container">
<table class="table table-striped table-bordered">
<caption>Allowance totals for our children</caption>
</thead>
<tr class="info">
<td>
Name
</td>
<td>
Amount
</td>
</tr>
</thead>
<tbody>
{{ range $name, $money := .children }}
<tr class="child">
<td class="name {{ $name }}">{{ $name }}</td>
<td class="amount">{{ dollarize $money }}</td>
</tr>
<tr class="controls">
<td colspan=2 style="text-align: center;">
<div class="btn-group">
<button class="btn" value="/add/{{ $name}}/100">$1.00</button>
<button class="btn" value="/add/{{ $name}}/25">25&cent;</button>
<button class="btn" value="/add/{{ $name}}/10">10&cent;</button>
<button class="btn" value="/add/{{ $name}}/5">5&cent;</button>
<button class="btn" value="/add/{{ $name}}/1">1&cent;</button>
</div>
<div style="padding-top: 5px;" class="btn-group">
<button class="btn btn-danger" value="/add/{{ $name}}/-100">$1.00</button>
<button class="btn btn-danger" value="/add/{{ $name}}/-25">25&cent;</button>
<button class="btn btn-danger" value="/add/{{ $name}}/-10">10&cent;</button>
<button class="btn btn-danger" value="/add/{{ $name}}/-5">5&cent;</button>
<button class="btn btn-danger" value="/add/{{ $name}}/-1">1&cent;</button>
</div>
</td>
</tr>
{{ end }}
</tbody>
</table>
</div>
{{ end }}