Files
MeshTender/internal/core/templates/invite.html
T

58 lines
2.7 KiB
HTML

{{define "title"}}Repeater invite · MeshTender{{end}}
{{define "header"}}
<div class="row g-2 align-items-center">
<div class="col"><h2 class="page-title">Repeater invite</h2></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>
<p class="text-secondary">This share link is no longer valid — it's single-use and may have already been used or revoked. 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="/logout" class="m-0">
<input type="hidden" name="next" value="/invite/{{.Token}}">
<button type="submit" class="btn btn-link">Switch account</button>
</form>
</div>
{{end}}
</div>
</div>
</div>
</div>
{{end}}