Convert templates to partials

This commit is contained in:
2021-12-02 15:00:53 +00:00
parent 67f7022b90
commit 77ae9d2dfd
16 changed files with 261 additions and 237 deletions

View File

@ -1,32 +1,26 @@
{{define "budget"}}
<!DOCTYPE html>
<html>
<head>
<title>Budgets</title>
{{template "base" .}}
{{template "head"}}
</head>
<body>
<div class="container" id="head">
Budgeteer - {{.Token.GetName}} - {{.Budget.Name}}
</div>
<div class="container"><a href="/budget/{{.Budget.ID}}/accounts">Go to Accounts</a></div>
<div class="budget-item">
<a href="#newbudgetmodal" data-toggle="modal" data-target="#newbudgetmodal">New Budget</a>
<span class="time"></span>
</div>
<table class="container col-lg-12" id="content">
{{range .Transactions}}
<tr>
<td>{{.Date}}</td>
<td>
<a href="transaction/{{.ID}}">{{.Memo.String}}</a>
</td>
<td>{{.Amount}}</td>
</tr>
{{end}}
</table>
{{template "transaction-new"}}
</body>
</html>
{{define "title"}}Budget{{end}}
{{define "new"}}
{{template "transaction-new"}}
{{end}}
{{define "main"}}
<div class="container"><a href="/budget/{{.Budget.ID}}/accounts">Go to Accounts</a></div>
<div class="budget-item">
<a href="#newbudgetmodal" data-toggle="modal" data-target="#newbudgetmodal">New Budget</a>
<span class="time"></span>
</div>
<table class="container col-lg-12" id="content">
{{range .Transactions}}
<tr>
<td>{{.Date}}</td>
<td>
<a href="transaction/{{.ID}}">{{.Memo.String}}</a>
</td>
<td>{{.Amount}}</td>
</tr>
{{end}}
</table>
{{end}}