Admin: Add user page

This commit is contained in:
Tom Wiesing 2023-01-04 16:10:55 +01:00
parent bc0e92bdac
commit d34e85a18f
No known key found for this signature in database
24 changed files with 456 additions and 77 deletions

View file

@ -0,0 +1,59 @@
{{ template "_base.html" . }}
{{ define "title" }}User{{ end }}
{{ define "header"}}
<p>
<a class="pure-button pure-button-primary" href="/user/">{{ .User.User }}</a>
</p>
<p>
<a class="pure-button pure-button-small" href="/user/logout/">Logout</a>
</p>
{{ end }}
{{ define "content" }}
<div class="pure-u-1">
<p>
{{ if .User.IsAdmin }}
You are an administrator.
{{ else }}
You are a regular user.
{{ end }}
{{ if .User.IsTOTPEnabled }}
You have TOTP enabled.
{{ else }}
You do not have TOTP enabled.
{{ end }}
</p>
<div class="pure-button-group" role="group" role="Actions">
<a class="pure-button" href="/user/password/">Change Password</a>
{{ if .User.IsTOTPEnabled }}
<a class="pure-button" href="/user/totp/disable/">Disable TOTP</a>
{{ else }}
<a class="pure-button" href="/user/totp/enable/">Enable TOTP</a>
{{ end }}
</div>
<hr />
</div>
{{ if .User.IsAdmin }}
<div class="pure-u-1">
{{ if (not .User.IsTOTPEnabled) }}
<div>
<p class="error-message">
TOTP is required to access these.
</p>
</div>
{{ end }}
<div class="pure-button-group" role="group" role="Actions">
<a class="pure-button" href="/admin/">Distillery Admin Page</a>
</div>
<hr />
</div>
{{ end }}
<div class="pure-u-1">
There will be a list of WissKIs you have access to here.
</div>
{{ end }}