mirror of
https://github.com/MeshTender/MeshTender.git
synced 2026-09-09 05:13:45 +00:00
61 lines
3.0 KiB
HTML
61 lines
3.0 KiB
HTML
{{define "title"}}Repeater invite · MeshTender{{end}}
|
|
{{define "header"}}
|
|
<div class="row g-2 align-items-center">
|
|
<div class="col"><h1 class="page-title fs-1">Repeater invite</h1></div>
|
|
</div>
|
|
{{end}}
|
|
{{define "content"}}
|
|
<div class="row justify-content-center">
|
|
<div class="col-12 col-md-7 col-lg-5">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
{{if eq .State "invalid"}}
|
|
<h2 class="card-title">Invalid link</h2>
|
|
{{/* Deliberately doesn't say WHICH reason: whoever holds this token
|
|
shouldn't learn whether it ever existed, was already claimed, or just
|
|
lapsed. Expiry is listed as a possibility so the message stays
|
|
accurate now that links have a shelf life. */}}
|
|
<p class="text-secondary">This share link is no longer valid — links are single-use and expire after {{.InviteTTLDays}} days, so it may have already been used, been revoked, or timed out. Ask the owner for a new one.</p>
|
|
<a class="back-link" href="/">{{template "icon-arrow-left" "me-1"}}Go to dashboard</a>
|
|
|
|
{{else if eq .State "auth_required"}}
|
|
<h2 class="card-title">You've been invited</h2>
|
|
<p>You've been invited to control <strong>{{.Repeater.Name}}</strong>, shared by {{.Repeater.OwnerName}}.</p>
|
|
<p class="text-secondary">Sign in or create an account to accept.</p>
|
|
<div class="btn-list">
|
|
<a class="btn btn-primary" href="/login?next={{.Next}}">Sign in</a>
|
|
<a class="btn" href="/signup?next={{.Next}}">Create account</a>
|
|
</div>
|
|
|
|
{{else if eq .State "owner"}}
|
|
<h2 class="card-title">This is your repeater</h2>
|
|
<p>You own <strong>{{.Repeater.Name}}</strong> — no need to accept your own link.</p>
|
|
<div class="btn-list">
|
|
<a class="btn btn-primary" href="/repeaters/{{.Repeater.PublicID}}/share">Manage sharing</a>
|
|
<a class="btn" href="/">Dashboard</a>
|
|
</div>
|
|
|
|
{{else if eq .State "already"}}
|
|
<h2 class="card-title">Already shared with you</h2>
|
|
<p>You already have access to <strong>{{.Repeater.Name}}</strong>.</p>
|
|
<a class="back-link" href="/">{{template "icon-arrow-left" "me-1"}}Go to dashboard</a>
|
|
|
|
{{else}}{{/* confirm */}}
|
|
<h2 class="card-title">Accept invite</h2>
|
|
<p>Accept access to <strong>{{.Repeater.Name}}</strong>, shared by {{.Repeater.OwnerName}}?</p>
|
|
<p class="text-secondary">You're signed in as <strong>{{.UserName}}</strong>.</p>
|
|
<div class="btn-list">
|
|
<form method="post" action="/invite/{{.Token}}/accept" class="m-0">
|
|
<button type="submit" class="btn btn-primary">Accept as {{.UserName}}</button>
|
|
</form>
|
|
<form method="post" action="{{.LogoutURL}}" class="m-0">
|
|
<button type="submit" class="btn btn-link">Switch account</button>
|
|
</form>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|