mirror of
https://github.com/MeshTender/MeshTender.git
synced 2026-09-02 10:03:43 +00:00
291 lines
13 KiB
HTML
291 lines
13 KiB
HTML
{{define "base"}}<!doctype html>
|
|
<html lang="en" data-bs-theme="dark" data-tz="{{.UserTZ}}">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
<link rel="icon" href="{{ asset "/static/favicon.svg" }}" type="image/svg+xml">
|
|
<title>{{block "title" .}}MeshTender{{end}}</title>
|
|
<link rel="stylesheet" href="{{ asset "/static/tabler.min.css" }}">
|
|
<link rel="stylesheet" href="{{ asset "/static/app.css" }}">
|
|
<script src="{{ asset "/static/tabler.min.js" }}" defer></script>
|
|
<script src="{{ asset "/static/htmx.min.js" }}" defer></script>
|
|
<script src="{{ asset "/static/ui.js" }}" defer></script>
|
|
<script src="{{ asset "/static/listfilter.js" }}" defer></script>
|
|
</head>
|
|
<body>
|
|
<a href="#main-content" class="visually-hidden-focusable btn btn-primary position-absolute top-0 start-0 m-2" style="z-index:1080">Skip to main content</a>
|
|
<div class="page">
|
|
<header class="navbar navbar-expand-md d-print-none">
|
|
<div class="container-xl">
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar-menu" aria-controls="navbar-menu" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<a href="{{if .UserName}}{{.AppURL}}{{else}}{{.RootURL}}{{end}}/" class="navbar-brand navbar-brand-autodark d-flex align-items-center text-reset text-decoration-none pe-0 pe-md-3">
|
|
{{template "icon-logo" "me-1"}}<span class="fw-bold fs-3">MeshTender</span>
|
|
</a>
|
|
<div class="navbar-nav flex-row order-md-last align-items-center gap-2">
|
|
{{if .UserName}}
|
|
<div class="nav-item dropdown">
|
|
{{/* A real <button>, not an anchor: it opens a menu rather than going
|
|
anywhere. As an <a href="#"> it was announced as a link, appended #
|
|
to the URL when used, and ignored the Space key (links only respond
|
|
to Enter). .nav-link already zeroes background/border, so it needs no
|
|
reset classes. */}}
|
|
<button type="button" class="nav-link d-flex lh-1 p-0 px-2" data-bs-toggle="dropdown" aria-label="Open user menu">
|
|
<span class="avatar avatar-sm">{{template "icon-user" ""}}</span>
|
|
<div class="d-none d-xl-block ps-2"><div>{{.UserName}}</div></div>
|
|
</button>
|
|
<div class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
|
|
<a class="dropdown-item" href="{{.AuthURL}}/account">{{template "icon-settings" "dropdown-item-icon"}}Account settings</a>
|
|
{{if .LogoutURL}}
|
|
<div class="dropdown-divider"></div>
|
|
<form method="post" action="{{.LogoutURL}}" class="m-0" data-testid="logout-form">
|
|
<button type="submit" class="dropdown-item text-danger">{{template "icon-logout" "dropdown-item-icon"}}Sign out</button>
|
|
</form>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
{{else}}
|
|
<a href="{{.AppURL}}/login" class="btn btn-primary">{{template "icon-login" "me-1"}}Sign in</a>
|
|
{{end}}
|
|
</div>
|
|
<div class="collapse navbar-collapse" id="navbar-menu">
|
|
<ul class="navbar-nav">
|
|
{{if .UserName}}
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{.AppURL}}/">
|
|
<span class="nav-link-icon d-md-none d-lg-inline-block">{{template "icon-home" ""}}</span>
|
|
<span class="nav-link-title">Dashboard</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{.AppURL}}/repeaters">
|
|
<span class="nav-link-icon d-md-none d-lg-inline-block">{{template "icon-antenna" ""}}</span>
|
|
<span class="nav-link-title">Repeaters</span>
|
|
</a>
|
|
</li>
|
|
{{end}}
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{if .UserName}}{{.AppURL}}{{else}}{{.RootURL}}{{end}}/orgs">
|
|
<span class="nav-link-icon d-md-none d-lg-inline-block">{{template "icon-world" ""}}</span>
|
|
<span class="nav-link-title">Organizations</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{.RootURL}}/docs">
|
|
<span class="nav-link-icon d-md-none d-lg-inline-block">{{template "icon-help" ""}}</span>
|
|
<span class="nav-link-title">Docs</span>
|
|
</a>
|
|
</li>
|
|
{{if .CanAdmin}}
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{.AppURL}}/admin">
|
|
<span class="nav-link-icon d-md-none d-lg-inline-block">{{template "icon-settings" ""}}</span>
|
|
<span class="nav-link-title">Admin</span>
|
|
</a>
|
|
</li>
|
|
{{end}}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<div class="page-wrapper">
|
|
<div class="page-header d-print-none" aria-label="Page header">
|
|
<div class="container-xl">
|
|
{{block "header" .}}
|
|
<div class="row g-2 align-items-center">
|
|
<div class="col">
|
|
<h1 class="page-title fs-1">MeshTender</h1>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
<div class="page-body">
|
|
<div class="container-xl" id="main-content" tabindex="-1">
|
|
{{block "content" .}}{{end}}
|
|
</div>
|
|
</div>
|
|
<footer class="footer footer-transparent d-print-none">
|
|
<div class="container-xl">
|
|
<div class="row text-center align-items-center flex-row-reverse">
|
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
|
<span class="text-secondary">MeshTender — tend your mesh.</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>{{end}}
|
|
|
|
{{/* rootnav is the public/root-host topbar: brand + Organizations, with the
|
|
sign-in/create-account actions collapsing to a single Dashboard button once
|
|
signed in (the root identity beacon sets .UserName). Shared by rootbase and
|
|
landingbase so every root page has an identical topbar. */}}
|
|
{{define "rootnav"}}
|
|
<header class="navbar navbar-expand-md d-print-none">
|
|
<div class="container-xl">
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar-menu" aria-controls="navbar-menu" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<a href="/" class="navbar-brand navbar-brand-autodark d-flex align-items-center text-reset text-decoration-none pe-0 pe-md-3">
|
|
{{template "icon-logo" "me-1"}}<span class="fw-bold fs-3">MeshTender</span>
|
|
</a>
|
|
<div class="navbar-nav flex-row order-md-last align-items-center gap-2">
|
|
{{if .UserName}}
|
|
<a href="{{.AppURL}}/" class="btn">{{template "icon-home" "me-1"}}Dashboard</a>
|
|
{{else}}
|
|
<a href="{{.AppURL}}/login" class="btn">{{template "icon-login" "me-1"}}Sign in</a>
|
|
<a href="{{.AppURL}}/signup" class="btn btn-primary">Create account</a>
|
|
{{end}}
|
|
</div>
|
|
<div class="collapse navbar-collapse" id="navbar-menu">
|
|
<ul class="navbar-nav">
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/orgs">
|
|
<span class="nav-link-icon d-md-none d-lg-inline-block">{{template "icon-world" ""}}</span>
|
|
<span class="nav-link-title">Organizations</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/docs">
|
|
<span class="nav-link-icon d-md-none d-lg-inline-block">{{template "icon-help" ""}}</span>
|
|
<span class="nav-link-title">Docs</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
{{end}}
|
|
|
|
{{/* rootbase is the public/root-host page layout: the shared rootnav topbar plus
|
|
the standard page chrome (header block, content, footer). The marketing
|
|
surface defaults to this so every root page matches the rest of the site. */}}
|
|
{{define "rootbase"}}<!doctype html>
|
|
<html lang="en" data-bs-theme="dark" data-tz="{{.UserTZ}}">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
<link rel="icon" href="{{ asset "/static/favicon.svg" }}" type="image/svg+xml">
|
|
<title>{{template "title" .}}</title>
|
|
<link rel="stylesheet" href="{{ asset "/static/tabler.min.css" }}">
|
|
<link rel="stylesheet" href="{{ asset "/static/app.css" }}">
|
|
<script src="{{ asset "/static/tabler.min.js" }}" defer></script>
|
|
<script src="{{ asset "/static/htmx.min.js" }}" defer></script>
|
|
<script src="{{ asset "/static/ui.js" }}" defer></script>
|
|
<script src="{{ asset "/static/listfilter.js" }}" defer></script>
|
|
</head>
|
|
<body>
|
|
<a href="#main-content" class="visually-hidden-focusable btn btn-primary position-absolute top-0 start-0 m-2" style="z-index:1080">Skip to main content</a>
|
|
<div class="page">
|
|
{{template "rootnav" .}}
|
|
<div class="page-wrapper">
|
|
<div class="page-header d-print-none" aria-label="Page header">
|
|
<div class="container-xl">
|
|
{{template "header" .}}
|
|
</div>
|
|
</div>
|
|
<div class="page-body">
|
|
<div class="container-xl" id="main-content" tabindex="-1">
|
|
{{template "content" .}}
|
|
</div>
|
|
</div>
|
|
<footer class="footer footer-transparent d-print-none">
|
|
<div class="container-xl">
|
|
<div class="row text-center align-items-center flex-row-reverse">
|
|
<div class="col-12 col-lg-auto mt-3 mt-lg-0">
|
|
<span class="text-secondary">MeshTender — tend your mesh.</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>{{end}}
|
|
|
|
{{/* authbase is a standalone, centered layout for the sign-in / sign-up pages —
|
|
no navbar or page chrome, just a brand logo above the page's content card.
|
|
Pages opt in with {{define "base"}}{{template "authbase" .}}{{end}}. */}}
|
|
{{define "authbase"}}<!doctype html>
|
|
<html lang="en" data-bs-theme="dark" data-tz="{{.UserTZ}}">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
<link rel="icon" href="{{ asset "/static/favicon.svg" }}" type="image/svg+xml">
|
|
<title>{{template "title" .}}</title>
|
|
<link rel="stylesheet" href="{{ asset "/static/tabler.min.css" }}">
|
|
<link rel="stylesheet" href="{{ asset "/static/app.css" }}">
|
|
<script src="{{ asset "/static/tabler.min.js" }}" defer></script>
|
|
<script src="{{ asset "/static/ui.js" }}" defer></script>
|
|
</head>
|
|
<body class="d-flex flex-column">
|
|
<div class="page page-center">
|
|
<div class="container container-tight py-4">
|
|
<div class="text-center mb-4">
|
|
<a href="/" class="navbar-brand navbar-brand-autodark d-inline-flex align-items-center text-reset text-decoration-none">
|
|
{{template "icon-logo" "me-1"}}<span class="fw-bold fs-2">MeshTender</span>
|
|
</a>
|
|
</div>
|
|
{{template "content" .}}
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>{{end}}
|
|
|
|
{{/* landingbase is the public marketing layout: a transparent navbar with
|
|
sign-in / sign-up actions, the page content, and a simple footer. Pages opt
|
|
in via the "Layout":"landingbase" render key. */}}
|
|
{{define "landingbase"}}<!doctype html>
|
|
<html lang="en" data-bs-theme="dark" data-tz="{{.UserTZ}}">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
<link rel="icon" href="{{ asset "/static/favicon.svg" }}" type="image/svg+xml">
|
|
<title>{{template "title" .}}</title>
|
|
<link rel="stylesheet" href="{{ asset "/static/tabler.min.css" }}">
|
|
<link rel="stylesheet" href="{{ asset "/static/app.css" }}">
|
|
<script src="{{ asset "/static/tabler.min.js" }}" defer></script>
|
|
<script src="{{ asset "/static/ui.js" }}" defer></script>
|
|
</head>
|
|
<body>
|
|
{{template "rootnav" .}}
|
|
{{template "content" .}}
|
|
<footer class="footer footer-transparent">
|
|
<div class="container">
|
|
<div class="row align-items-center justify-content-center">
|
|
<div class="col-auto text-secondary">MeshTender — tend your mesh.</div>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html>{{end}}
|
|
|
|
{{/* revokedoc explains how to revoke MeshTender's access. Dot is the revoke command string. */}}
|
|
{{define "revokedoc"}}
|
|
<details class="mt-3">
|
|
<summary class="text-secondary" style="cursor:pointer">How to revoke MeshTender's access later</summary>
|
|
<p class="text-secondary mt-2">
|
|
Granting access is a standing trust: MeshTender keeps admin on your repeater until <strong>you</strong>
|
|
remove it — deleting the repeater from this site does <strong>not</strong> revoke it. To revoke, run this
|
|
on the repeater (via its BLE/USB companion app or another admin client):
|
|
</p>
|
|
<div class="input-group">
|
|
<code class="form-control font-monospace text-secondary">{{.}}</code>
|
|
<button type="button" class="btn" data-copy-prev>{{template "icon-copy" ""}}Copy</button>
|
|
</div>
|
|
<p class="text-secondary mt-2 mb-0">With no level argument, that <strong>removes MeshTender from the repeater's ACL entirely</strong>.</p>
|
|
</details>
|
|
{{end}}
|
|
|
|
{{/* repstatus renders confirmation provenance + access badges for a *store.Repeater. */}}
|
|
{{define "repstatus"}}
|
|
{{- if not .Confirmed -}}
|
|
<span class="badge bg-yellow-lt" title="No one has reached this repeater through MeshTender yet">Unconfirmed</span>
|
|
{{- end -}}
|
|
{{- if and .AccessKnown (not .IsAdmin)}}<span class="badge bg-warning-lt">guest only</span>{{end -}}
|
|
{{end}}
|