Files
coredns-web-ui/templates/html/layout.html
T
bryanpedini 5ac8f98f10 chore(ui): add module file and main stub
- chore(ui): add module file and main stub
- feat(ui): add layout, pages and partials
- feat(ui): add stylesheet and scripts
- feat(ui): add page renderer and static file handler
- test(ui): cover rendering, escaping and static serving
2026-11-19 15:46:12 +01:00

35 lines
1.6 KiB
HTML

{{- /* SPDX-License-Identifier: GPL-2.0-or-later */ -}}
{{- /* Copyright (C) 2026 Bryan Joshua Pedini */ -}}
{{define "layout"}}<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="light dark">
<title>{{template "title" .}} - {{.AppName}}</title>
<link rel="icon" href="data:,">
<link rel="stylesheet" href="{{.Static}}css/app.css">
{{if .Script}}<script type="module" src="{{.Static}}js/{{.Script}}.js"></script>
{{end}}</head>
<body>
<a class="skip" href="#app">Skip to content</a>
<header class="topbar">
<a class="brand" href="/">{{.AppName}}</a>
{{if .Username}}<nav class="nav" aria-label="Main">
<a href="/"{{if eq .Section "zones"}} aria-current="page"{{end}}>Zones</a>
<a href="/audit"{{if eq .Section "audit"}} aria-current="page"{{end}}>Audit</a>
<a href="/account"{{if eq .Section "account"}} aria-current="page"{{end}}>Account</a>
{{if .IsAdmin}}<a href="/users"{{if eq .Section "users"}} aria-current="page"{{end}}>Users</a>
{{end}}</nav>
<form class="logout" method="post" action="/logout">
<span class="who"><span class="who-name">{{.Username}}</span> <span class="badge badge-muted">{{.Role}}</span></span>
<button type="submit" class="btn btn-small">Log out</button>
</form>
{{end}}</header>
<main id="app" class="page page-{{.Page}}" tabindex="-1" data-page="{{.Page}}" data-username="{{.Username}}" data-role="{{.Role}}" data-zone="{{.Zone}}" data-target-user="{{.TargetUser}}">
{{template "content" .}}
</main>
<div id="toasts" class="toasts" role="status" aria-live="polite" aria-atomic="false"></div>
</body>
</html>{{end}}