budgeteer/web/budgeting.html

40 lines
1.2 KiB
HTML

{{template "base" .}}
{{define "title"}}
{{printf "Budget for %s %d" .Date.Month .Date.Year}}
{{end}}
{{define "new"}}
{{template "transaction-new"}}
{{end}}
{{define "main"}}
<div class="budget-item">
<a href="#newtransactionmodal" data-toggle="modal" data-target="#newtransactionmodal">New Transaction</a>
<span class="time"></span>
</div>
<div>
<a href="{{printf "/budget/%s/%d/%d" .Budget.ID .Previous.Year .Previous.Month}}">Previous Month</a> -
<a href="{{printf "/budget/%s" .Budget.ID}}">Current Month</a> -
<a href="{{printf "/budget/%s/%d/%d" .Budget.ID .Next.Year .Next.Month}}">Next Month</a>
</div>
<table class="container col-lg-12" id="content">
{{range .Categories}}
<tr>
<td>{{.Group}}</td>
<td>{{.Name}}</td>
<td>
</td>
<td>
</td>
<td style="text-align: right;{{if .Balance.GetPositive}}{{else}}color: red;{{end}}">
{{printf "%.2f" .Balance.GetFloat64}}
</td>
<td style="text-align: right;{{if .Activity.GetPositive}}{{else}}color: red;{{end}}">
{{printf "%.2f" .Activity.GetFloat64}}
</td>
</tr>
{{end}}
</table>
{{end}}