30 lines
1.4 KiB
HTML
30 lines
1.4 KiB
HTML
|
|
{{define "title"}}Add receipt{{end}}
|
||
|
|
{{define "content"}}
|
||
|
|
<header>
|
||
|
|
<span>{{.Subject}}</span>
|
||
|
|
<span><a href="/manage">Manage</a> · <a href="/export">Export</a> · <a href="/logout">Log out</a></span>
|
||
|
|
</header>
|
||
|
|
<h1>Add receipt</h1>
|
||
|
|
{{range .Errors}}<div class="err">{{.}}</div>{{end}}
|
||
|
|
<form method="post" action="/upload" enctype="multipart/form-data">
|
||
|
|
<label for="receipt">Receipt photo or PDF</label>
|
||
|
|
<input id="receipt" type="file" name="receipt" accept="image/*,application/pdf" capture="environment" required>
|
||
|
|
<label for="amount">Amount ($)</label>
|
||
|
|
<input id="amount" type="number" name="amount" step="0.01" min="0.01" inputmode="decimal" value="{{.Amount}}" required>
|
||
|
|
<label for="receipt_date">Date on receipt</label>
|
||
|
|
<input id="receipt_date" type="date" name="receipt_date" value="{{.Date}}" required>
|
||
|
|
<label for="category_id">Category</label>
|
||
|
|
<select id="category_id" name="category_id">
|
||
|
|
{{$sc := .CategoryID}}
|
||
|
|
{{range .Categories}}<option value="{{.ID}}" {{if eq (printf "%d" .ID) $sc}}selected{{end}}>{{.Label}}</option>{{end}}
|
||
|
|
</select>
|
||
|
|
<label for="person_id">Who</label>
|
||
|
|
<select id="person_id" name="person_id">
|
||
|
|
{{$sp := .PersonID}}
|
||
|
|
<option value="">—</option>
|
||
|
|
{{range .People}}<option value="{{.ID}}" {{if eq (printf "%d" .ID) $sp}}selected{{end}}>{{.Label}}</option>{{end}}
|
||
|
|
</select>
|
||
|
|
<button type="submit" class="primary">Submit</button>
|
||
|
|
</form>
|
||
|
|
{{end}}
|