wisski-cloud-distillery/internal/dis/component/auth/panel/templates/user.html
2023-12-02 00:03:59 +01:00

91 lines
No EOL
2.9 KiB
HTML

<div class="pure-u-1">
<p>
<ul>
<li>Username: <code>{{ .User.User }}</code></li>
{{ 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 }}
{{ $showAdminURLs := .ShowAdminURLs }}
<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="h-md-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>
{{ if $showAdminURLs }}
<th>
Distillery Admin Link
</th>
{{ end }}
</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>
{{ if $showAdminURLs }}
<td>
<a href="{{ $grant.AdminURL }}" class="pure-button" target="_blank" rel="noopener noreferer">
{{ $grant.AdminURL }}
</a>
</td>
{{ end }}
</tr>
{{ end }}
</tbody>
</table>
</div>
</div>
</div>