hsa-app/internal/web/templates/tally.html

42 lines
1.1 KiB
HTML
Raw Permalink Normal View History

{{define "title"}}Tally{{end}}
{{define "content"}}
<header>
<span><a href="/">← Add receipt</a></span>
<span><a href="/recent">Recent</a> · <a href="/manage">Manage</a> · <a href="/export">Export</a></span>
</header>
<h1>Tally</h1>
{{if .Empty}}
<p><small>No receipts yet. Totals will appear here once you add some.</small></p>
{{else}}
<p><small>Totals by person and receipt-date year, in dollars. Right column is each
person's total; bottom row is each year's total.</small></p>
<div class="tally-wrap">
<table class="tally">
<thead>
<tr>
<th>Who</th>
{{range .Years}}<th class="num">{{.}}</th>{{end}}
<th class="num total">Total</th>
</tr>
</thead>
<tbody>
{{range .Rows}}
<tr>
<th>{{.Person}}</th>
{{range .Cells}}<td class="num">{{if .}}{{.}}{{else}}<span class="muted"></span>{{end}}</td>{{end}}
<td class="num total">{{.Total}}</td>
</tr>
{{end}}
</tbody>
<tfoot>
<tr>
<th>Total</th>
{{range .YearTotals}}<td class="num total">{{.}}</td>{{end}}
<td class="num grand">{{.Grand}}</td>
</tr>
</tfoot>
</table>
</div>
{{end}}
{{end}}