58 lines
2.0 KiB
HTML
58 lines
2.0 KiB
HTML
{{ define "content" }}
|
|
<div class="container py-5">
|
|
<h2>Manage Invite Links</h2>
|
|
|
|
{{ if .Tokens }}
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Invite Link</th>
|
|
<th>Invited By</th>
|
|
<th>Status</th>
|
|
<th>Expires</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{ range .Tokens }}
|
|
<tr>
|
|
<td>
|
|
<code>/syndicate/join?token={{ .Token }}</code>
|
|
</td>
|
|
<td>User #{{ .InvitedByUserID }}</td>
|
|
<td>
|
|
{{ if .AcceptedByUserID.Valid }}
|
|
<span class="text-success" title="Joined on {{ .AcceptedAt.Time.Format \"02 Jan 2006 15:04\" }}">
|
|
Accepted by User #{{ .AcceptedByUserID.Int64 }}
|
|
</span>
|
|
{{ else if .ExpiresAt.Before (now) }}
|
|
<span class="text-danger" title="Expired on {{ .ExpiresAt.Format \"02 Jan 2006 15:04\" }}">Expired</span>
|
|
{{ else }}
|
|
<span class="text-warning" title="Expires in {{ humanizeTime .ExpiresAt }}">Pending</span>
|
|
{{ end }}
|
|
</td>
|
|
<td>{{ .ExpiresAt.Format "02 Jan 2006 15:04" }}</td>
|
|
<td>
|
|
{{ if not .AcceptedByUserID.Valid }}
|
|
<form method="POST" action="/account/syndicates/invite/revoke?token={{ .Token }}&id={{ $.SyndicateID }}" class="d-inline">
|
|
{{ $.CSRFField }}
|
|
<button class="btn btn-sm btn-outline-danger" title="Invalidate this token">Revoke</button>
|
|
</form>
|
|
{{ end }}
|
|
<form method="POST" action="/account/syndicates/invite/token?id={{ $.SyndicateID }}" class="d-inline">
|
|
{{ $.CSRFField }}
|
|
<button class="btn btn-sm btn-outline-secondary" title="Create a new invite token">Regenerate</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{{ end }}
|
|
</tbody>
|
|
</table>
|
|
{{ else }}
|
|
<div class="alert alert-info">No invite links found for this syndicate.</div>
|
|
{{ end }}
|
|
|
|
<a href="/syndicate/view?id={{ .SyndicateID }}" class="btn btn-secondary mt-3">← Back</a>
|
|
</div>
|
|
{{ end }}
|