Jan Dittberner
44e18ca3a5
The primary change in this commit is the introduction of consent management. A few minor improvements have been made: - move common header to ui/templates/base.gohtml - add an I18NService to unify localization - add a handlers.getLocalizer function - fix translation extraction and merging in Makefile - add a new AuthMiddleware to centralize client certificate authentication - move client certificate handling to internal/handlers/security.go - improver error handling, allow localization of HTTP error messages
47 lines
No EOL
1.9 KiB
Text
47 lines
No EOL
1.9 KiB
Text
{{ define "content" }}
|
|
<main role="main" class="container">
|
|
<h1>{{ .Title }}</h1>
|
|
<p class="text-left">{{ .Description }}</p>
|
|
{{ range .Flashes}}
|
|
<div class="alert alert-{{ .Type }}" role="alert">
|
|
{{ .Message }}
|
|
</div>
|
|
{{ end }}
|
|
{{ $buttonTitleRevoke := .ButtonTitleRevoke }}
|
|
{{ $unknownLabel := .LabelUnknown }}
|
|
{{ $neverLabel := .LabelNever }}
|
|
{{ if .ConsentSessions }}
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>{{ .ApplicationTitle }}</th>
|
|
<th>{{ .SubjectTitle }}</th>
|
|
<th>{{ .GrantedTitle }}</th>
|
|
<th>{{ .ExpiresTitle }}</th>
|
|
<th>{{ .ActionsTitle }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{ range .ConsentSessions }}
|
|
<tr>
|
|
<td>{{ .GetClientName }}</td>
|
|
<td>{{ .Subject }}</td>
|
|
<td>{{ if .GrantedAt }}<span
|
|
title="{{ .GrantedAt }}">{{ .GrantedAt | humantime }}</span>{{ else }}{{ $unknownLabel }}{{ end }}
|
|
</td>
|
|
<td>{{ if .Expires }}<span
|
|
title="{{ .Expires }}">{{ .Expires | humantime }}</span>{{ else }}{{ $neverLabel }}{{ end }}
|
|
</td>
|
|
<td><a href="/revoke-consent/{{ .GetID }}?subject={{ .Subject }}" class="btn btn-danger"
|
|
role="button">{{ $buttonTitleRevoke }}</a></td>
|
|
</tr>
|
|
{{ end }}
|
|
</tbody>
|
|
</table>
|
|
{{ else}}
|
|
<div class="alert alert-info">
|
|
{{ .NoConsentGiven }}
|
|
</div>
|
|
{{ end}}
|
|
</main>
|
|
{{ end }} |