wisski-cloud-distillery/internal/dis/component/auth/panel/templates/user.html
2023-01-12 13:55:07 +01:00

83 lines
No EOL
2.4 KiB
HTML

{{ template "_base.html" . }}
{{ define "title" }}User{{ 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> {{ if .User.IsAdmin }}<small>(some admin actions are disabled)</small>{{ end }}</li>
{{ end }}
</ul>
</p>
<hr />
</div>
{{ if .User.IsAdmin }}
<div class="pure-u-1">
{{ if (not .User.IsTOTPEnabled) }}
<div>
<p class="error-message">
You are an administrator, but do not have TOTP enabled.
Please turn it on to access the admin page.
</p>
</div>
{{ end }}
</div>
{{ end }}
<div class="pure-u-1">
<h2>Your WissKIs</h2>
<p>
This is a page of WissKIs you have access to.
Click on the button containing the name to login.
</p>
</div>
<div class="pure-u-1">
<div class="padding">
<div class="overflow">
<table class="pure-table pure-table-bordered pure-form">
<thead>
<tr>
<th>
WissKI Slug
</th>
<th>
Drupal Username
</th>
<th>
Admin
</th>
</tr>
</thead>
<tbody>
{{ range $id, $grant := .Grants }}
<tr>
<td>
<a href="{{ $grant.URL }}" class="pure-button" target="_blank" rel="noopener noreferer">
{{ $grant.Slug }}
</a>
</td>
<td>
{{ $grant.DrupalUsername }}
</td>
<td>
{{ $grant.DrupalAdminRole }}
</td>
</tr>
{{ end }}
</tbody>
</table>
</div>
</div>
</div>
{{ end }}