74 lines
2.3 KiB
HTML
74 lines
2.3 KiB
HTML
{{template "base" .}}
|
|
|
|
{{define "title"}}{{.Account.Name}}{{end}}
|
|
|
|
{{define "new"}}
|
|
{{template "transaction-new" .}}
|
|
{{end}}
|
|
|
|
{{define "main"}}
|
|
<div class="budget-item">
|
|
<a href="#newtransactionmodal" data-bs-toggle="modal" data-bs-target="#newtransactionmodal">New Transaction</a>
|
|
<span class="time"></span>
|
|
</div>
|
|
<table class="container col-lg-12" id="content">
|
|
<form id="newtransactionform" action="/api/v1/transaction/new" method="POST">
|
|
<td>
|
|
<input type="hidden" name="account_id" value="{{.Account.ID}}" />
|
|
<input type="date" name="date" class="form-control" value="{{now.Format "2006-01-02"}}" />
|
|
</td>
|
|
<td>
|
|
{{.Account.Name}}
|
|
</td>
|
|
<td>
|
|
<input list="payees" name="payee_id" class="form-control">
|
|
<datalist id="payees">
|
|
<option value="">-- none --</option>
|
|
{{range .Payees}}
|
|
<option data-value="{{.ID}}">{{.Name}}</option>
|
|
{{- end}}
|
|
</datalist>
|
|
</td>
|
|
<td>
|
|
<input list="categories" name="category_id" class="form-control">
|
|
<datalist id="categories">
|
|
<option value="">-- none --</option>
|
|
{{range .Categories}}
|
|
<option data-value="{{.ID}}">{{.Group}} : {{.Name}}</option>
|
|
{{- end}}
|
|
</select>
|
|
</td>
|
|
<td></td>
|
|
<td>
|
|
<input type="text" name="memo" class="form-control" />
|
|
</td>
|
|
<td>
|
|
<input type="number" name="amount" class="form-control" placeholder="0.00" />
|
|
<input type="submit" class="btn btn-primary" name="create" value="Create" class="form-control" />
|
|
</td>
|
|
</form>
|
|
{{range .Transactions}}
|
|
<tr class="{{if .Date.After now}}future{{end}}">
|
|
<td>{{.Date.Format "02.01.2006"}}</td>
|
|
<td>
|
|
{{.Account}}
|
|
</td>
|
|
<td>
|
|
{{.Payee}}
|
|
</td>
|
|
<td>
|
|
{{if .CategoryGroup}}
|
|
{{.CategoryGroup}} : {{.Category}}
|
|
{{end}}
|
|
</td>
|
|
<td>
|
|
{{if .GroupID.Valid}}☀{{end}}
|
|
</td>
|
|
<td>
|
|
<a href="/budget/{{$.Budget.ID}}/transaction/{{.ID}}">{{.Memo}}</a>
|
|
</td>
|
|
{{template "amount-cell" .Amount}}
|
|
</tr>
|
|
{{end}}
|
|
</table>
|
|
{{end}} |