Split "auth" and "user" routes
This commit is contained in:
parent
f3939c5016
commit
59b565ae19
15 changed files with 148 additions and 99 deletions
62
internal/dis/component/auth/panel/templates/user.html
Normal file
62
internal/dis/component/auth/panel/templates/user.html
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
{{ 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="/auth/logout/">Logout</a>
|
||||
</p>
|
||||
{{ end }}
|
||||
|
||||
{{ define "content" }}
|
||||
<div class="pure-u-1">
|
||||
<p>
|
||||
<ul>
|
||||
{{ if .User.IsAdmin }}
|
||||
<li>Role: <b>Administrator</b></li>
|
||||
{{ else }}
|
||||
<li>Role: <b>Regular User</b></li>
|
||||
{{ end }}
|
||||
|
||||
{{ if .User.IsTOTPEnabled }}
|
||||
<li>Passcode Enabled: <b>true</b></li>
|
||||
{{ else }}
|
||||
<li>Passcode Enabled: <b>false</b> <small>(some actions are disabled)</small></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</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 Passcode (TOTP)</a>
|
||||
{{ else }}
|
||||
<a class="pure-button" href="/user/totp/enable/">Enable Passcode (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 }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue