hsa-app/internal/web/templates/recent.html
Jean-Michel Tremblay 04d6e8177d Add receipt attachments captured at upload time (spec item 10)
- New attachments table (FK to receipts), dual-write: file on disk + DB blob.
- On-disk layout split: receipts under <ROOT>/receipts/<YYYY>/..., attachments
  under <ROOT>/attachments/<YYYY>/..., attachments named from the parent
  receipt's date+amount stem (_att, _att_1, ...).
- Upload form gains an optional multi-file "Additional files" field; the files
  ride along with POST /upload, saved after the receipt row exists. No AI runs
  on attachments; primary-image auto-fill unchanged.
- GET /attachment/{id}/file serves blobs; confirm page lists them; recent list
  links them. Adding attachments to an already-saved receipt is not yet supported.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 07:06:15 -04:00

31 lines
1.2 KiB
HTML

{{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 href="/receipt/{{.ID}}/file" target="_blank">${{.Amount}}</a>
· {{.Date}} · {{.Category}}{{if .Who}} · {{.Who}}{{end}}
<br><small>{{.Filename}} — uploaded {{.When}}</small>
{{if .Attachments}}<br><small>attachments: {{range $i, $a := .Attachments}}{{if $i}}, {{end}}<a href="/attachment/{{$a.ID}}/file" target="_blank">{{$a.Filename}}</a>{{end}}</small>{{end}}
</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}}