authorization enforced on webpages

This commit is contained in:
2025-12-30 18:08:22 -07:00
parent c01d700482
commit 240d82344c
24 changed files with 509 additions and 123 deletions
@@ -2,7 +2,19 @@
{{/* "dot" . */}}
<nav>
<nav
style="
margin: 0;
padding: 1em;
background-color: #bdf;
font-size: 1.25em;
display: flex;
flex-direction: column;
align-items: center;
"
>
<ul>
<li>
<a href="/">
@@ -10,22 +22,38 @@
</a>
</li>
{{- if .dot.UserID }}
{{/* */}}
{{- $userID := .dot.Identity.User.UserID }}
{{- $acct := .dot.Identity.Account }}
{{- $acctID := 0 }}
{{- if $acct }}
{{- $acctID = $acct.ID }}
{{- end }}
{{- if not $userID }}
<li>
<a href="/accounts/{{.dot.Account.ID}}">
<a href="/login">
Log In / Sign Up
</a>
</li>
{{- else if $acctID }}
<li>
<a href="/accounts/{{$acctID}}">
Account
</a>
</li>
<li>
<a href="/accounts/{{.dot.Account.ID}}/reports">
<a href="/accounts/{{$acctID}}/reports">
Reports
</a>
</li>
<li>
<a href="/accounts/{{.dot.Account.ID}}/inventory">
<a href="/accounts/{{$acctID}}/inventory">
Inventory
</a>
</li>
@@ -36,14 +64,6 @@
</a>
</li>
{{- else }}
<li>
<a href="/login">
Log In / Sign Up
</a>
</li>
{{- end }}
</ul>
</nav>