Add sidebar

This commit is contained in:
Jan Bader 2021-12-04 22:30:48 +00:00
parent cb1297b8bf
commit e30fab6a06
3 changed files with 65 additions and 5 deletions

View File

@ -19,6 +19,10 @@
{{block "more-head" .}}{{end}}
</head>
<body>
<div id="sidebar">
{{template "sidebar" .}}
</div>
<div id="content">
<div class="container" id="head">
{{template "title" .}}
</div>
@ -26,6 +30,7 @@
{{template "main" .}}
</div>
{{block "new" .}}{{end}}
</div>
</body>
</html>
{{end}}

27
web/sidebar.tpl Normal file
View File

@ -0,0 +1,27 @@
{{define "sidebar"}}
<ul>
<li>Budget (Coming Soon)</li>
<li>Reports (Coming Soon)</li>
<li>All Accounts</li>
<li>
On-Budget Accounts
<ul class="two-valued">
{{range .Accounts}}
<li>
<a href="/account/{{.ID}}">{{.Name}}</a>
<span class="right">{{printf "%.2f" .Balance.GetFloat64}}</span>
</li>
{{end}}
</ul>
</li>
<li>
Off-Budget Accounts
</li>
<li>
Closed Accounts
</li>
<li>
+ Add Account
</li>
</ul>
{{end}}

View File

@ -32,3 +32,31 @@
text-align: center;
font-size: 70.7%;
}
body {
display: grid;
grid-template-columns: 300px auto;
}
#sidebar {
margin: 1em;
font-size: 180%;
}
#sidebar ul {
padding: 0;
list-style: none;
font-size: 75%;
}
.two-valued {
display: table;
}
.two-valued * {
display: table-row;
}
.two-valued * * {
display: table-cell;
}
.right {
text-align: right;
}