mirror of
https://github.com/MeshTender/MeshTender.git
synced 2026-09-07 04:14:03 +00:00
324 lines
16 KiB
HTML
324 lines
16 KiB
HTML
{{define "base"}}<!doctype html>
|
|
<html lang="en" data-bs-theme="dark" data-tz="{{.UserTZ}}" data-carto-key="{{.CartoKey}}" data-maplibre-worker="{{ asset "/static/maplibre-gl-worker.js" }}">
|
|
<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">{{template "footerbody" .}}</div>
|
|
</footer>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>{{end}}
|
|
|
|
{{/* footerbody is the one footer used by every layout, so the legal links can't
|
|
go missing on a surface. /privacy and /terms are served by the root host
|
|
only, hence absolute URLs: the app and auth hosts have no such routes.
|
|
The source link is the AGPL section 13 offer — the source of the program
|
|
you are interacting with, reachable from every page. */}}
|
|
{{define "footerbody"}}
|
|
<div class="row text-center align-items-center flex-row-reverse gy-2">
|
|
<div class="col-12 col-lg-auto">
|
|
<span class="text-secondary">MeshTender — tend your mesh.</span>
|
|
</div>
|
|
<div class="col-12 col-lg-auto">
|
|
<ul class="list-inline list-inline-dots mb-0">
|
|
<li class="list-inline-item"><a class="link-secondary" href="{{.RootURL}}/docs">Docs</a></li>
|
|
<li class="list-inline-item"><a class="link-secondary" href="{{.RootURL}}/privacy">Privacy</a></li>
|
|
<li class="list-inline-item"><a class="link-secondary" href="{{.RootURL}}/terms">Terms</a></li>
|
|
<li class="list-inline-item"><a class="link-secondary" href="{{.SourceURL}}" rel="noopener">Source</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
{{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}}" data-carto-key="{{.CartoKey}}" data-maplibre-worker="{{ asset "/static/maplibre-gl-worker.js" }}">
|
|
<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">{{template "footerbody" .}}</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}}.
|
|
It still carries footerbody: the legal links and the AGPL section 13 source
|
|
offer are owed on every surface, and someone signing in is as much a user of
|
|
this server as someone already signed in. */}}
|
|
{{define "authbase"}}<!doctype html>
|
|
<html lang="en" data-bs-theme="dark" data-tz="{{.UserTZ}}" data-carto-key="{{.CartoKey}}" data-maplibre-worker="{{ asset "/static/maplibre-gl-worker.js" }}">
|
|
<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" .}}
|
|
<footer class="footer footer-transparent d-print-none mt-4 footer-centered">{{template "footerbody" .}}</footer>
|
|
</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}}" data-carto-key="{{.CartoKey}}" data-maplibre-worker="{{ asset "/static/maplibre-gl-worker.js" }}">
|
|
<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">{{template "footerbody" .}}</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}}
|
|
|
|
{{/* map-styles / map-scripts are the vendored map stack, in one place rather than
|
|
hand-listed by each of the ten pages that render a map — which is how the
|
|
Leaflet list they replaced managed to drift. Include map-styles above the map
|
|
container and map-scripts before the page's own map call.
|
|
|
|
Order matters: maplibre-gl.js defines the global the adapter and basemap.js
|
|
both reach for, and basemap.js defines meshCreateMap, which meshmap.js and
|
|
regionmap.js build on. terra-draw is only needed where a shape is drawn, so
|
|
map-draw-scripts is separate — no reason to ship 244KB to a page that just
|
|
shows dots. */}}
|
|
{{define "map-styles"}}
|
|
<link rel="stylesheet" href="{{ asset "/static/maplibre-gl.css" }}">
|
|
{{end}}
|
|
|
|
{{define "map-scripts"}}
|
|
<script src="{{ asset "/static/maplibre-gl.js" }}"></script>
|
|
<script src="{{ asset "/static/basemap.js" }}"></script>
|
|
{{end}}
|
|
|
|
{{define "map-draw-scripts"}}
|
|
<script src="{{ asset "/static/terra-draw.js" }}"></script>
|
|
<script src="{{ asset "/static/terra-draw-maplibre-gl-adapter.js" }}"></script>
|
|
{{end}}
|