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

32 lines
1.2 KiB
HTML
Raw Normal View History

{{define "title"}}{{.Title}}{{end}}
{{define "content"}}
<header>
<span><a href="/">← Add receipt</a></span>
<span><a href="/tally">Tally</a> · <a href="/manage">Manage</a> · <a href="/export">Export</a></span>
</header>
<h1>{{.Title}}</h1>
<p class="tabs">
<a href="/recent"{{if eq .BasePath "/recent"}} class="active"{{end}}>By upload date</a> ·
<a href="/recent/receipts"{{if eq .BasePath "/recent/receipts"}} class="active"{{end}}>By receipt date</a>
</p>
{{if not .Rows}}
<p><small>No receipts to show.</small></p>
{{else}}
<ul class="recent">
{{range .Rows}}
<li>
<a class="amt" href="/receipt/{{.ID}}/file" target="_blank">${{.Amount}}</a>
<span class="meta">{{.Date}} · {{.Category}}{{if .Who}} · {{.Who}}{{end}}</span>
{{if .Attachments}}<span class="atts">{{range .Attachments}}<a href="/attachment/{{.ID}}/file" target="_blank" title="{{.Filename}}">📎</a>{{end}}</span>{{end}}
<span class="when">{{.When}}</span>
</li>
{{end}}
</ul>
<p class="pager">
{{if .PrevURL}}<a href="{{.PrevURL}}">← Newer</a>{{end}}
{{if and .PrevURL .NextURL}} · {{end}}
{{if .NextURL}}<a href="{{.NextURL}}">Load next 10 →</a>{{end}}
</p>
{{end}}
{{end}}