40 lines
2.0 KiB
HTML
40 lines
2.0 KiB
HTML
{{/* html/template requires {{template "name"}} names to be string
|
|
literals, not dynamic pipelines — so a single "layout" wrapper that
|
|
dispatches to a per-page content block by name isn't possible within
|
|
one shared template set. Instead, layout.html provides small named
|
|
partials (html_head, page_header, banner_inner, error_banner) that
|
|
each page's *_page template (see e.g. overview.html) assembles
|
|
around its own *_content block explicitly. A few lines of
|
|
boilerplate are duplicated per page as a result — see any *_page
|
|
define for the pattern. */}}
|
|
|
|
{{define "html_head"}}
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Cloud IP Validator — Admin</title>
|
|
<link rel="stylesheet" href="/static/vendor/pico.classless.min.css">
|
|
<link rel="stylesheet" href="/static/dashboard.css">
|
|
<script src="/static/vendor/htmx.min.js"></script>
|
|
<script src="/static/vendor/alpine.min.js" defer></script>
|
|
{{end}}
|
|
|
|
{{define "page_header"}}
|
|
<header>
|
|
<nav class="dashboard-nav">
|
|
<strong>Cloud IP Validator</strong>
|
|
<ul>
|
|
<li><a href="/overview" {{if eq .ActiveNav "overview"}}aria-current="page"{{end}}>Обзор</a></li>
|
|
<li><a href="/ips" {{if eq .ActiveNav "ips"}}aria-current="page"{{end}}>Очередь IP</a></li>
|
|
<li><a href="/validators" {{if eq .ActiveNav "validators"}}aria-current="page"{{end}}>Валидаторы</a></li>
|
|
<li><a href="/sites" {{if eq .ActiveNav "sites"}}aria-current="page"{{end}}>Площадки</a></li>
|
|
<li><a href="/targets" {{if eq .ActiveNav "targets"}}aria-current="page"{{end}}>Цели</a></li>
|
|
<li><a href="/check-types" {{if eq .ActiveNav "check-types"}}aria-current="page"{{end}}>Типы проверок</a></li>
|
|
</ul>
|
|
</nav>
|
|
</header>
|
|
{{end}}
|
|
|
|
{{define "banner_inner"}}{{if .Message}}<div class="error-banner {{if .Client}}error-banner-client{{else}}error-banner-server{{end}}">{{.Message}}</div>{{end}}{{end}}
|
|
|
|
{{define "error_banner"}}<div id="error-banner" hx-swap-oob="true">{{template "banner_inner" .}}</div>{{end}}
|