75 lines
3.6 KiB
HTML
75 lines
3.6 KiB
HTML
{{define "base.html"}}
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, interactive-widget=resizes-content">
|
|
<title>{{block "title" .}}Chat Switchboard{{end}}</title>
|
|
<link rel="icon" type="image/svg+xml" href="{{.BasePath}}/favicon.svg?v={{.Version}}">
|
|
<link rel="icon" type="image/x-icon" href="{{.BasePath}}/favicon.ico?v={{.Version}}">
|
|
<link rel="stylesheet" href="{{.BasePath}}/css/styles.css?v={{.Version}}">
|
|
{{if eq .Surface "chat"}}{{template "css-chat" .}}{{end}}
|
|
{{if eq .Surface "admin"}}{{template "css-admin" .}}{{end}}
|
|
{{if eq .Surface "editor"}}{{template "css-editor" .}}{{end}}
|
|
{{if eq .Surface "notes"}}{{template "css-notes" .}}{{end}}
|
|
{{if eq .Surface "settings"}}{{template "css-settings" .}}{{end}}
|
|
<style>
|
|
:root {
|
|
--banner-h: 28px;
|
|
--banner-top-h: {{if .Banner.Visible}}var(--banner-h){{else}}0px{{end}};
|
|
--banner-bot-h: {{if .Banner.Visible}}var(--banner-h){{else}}0px{{end}};
|
|
--surface-h: calc(100vh - var(--banner-top-h) - var(--banner-bot-h));
|
|
}
|
|
body { margin: 0; background: var(--bg-primary, #0e0e10); color: var(--text-primary, #e0e0e0); }
|
|
.surface { height: var(--surface-h); overflow: hidden; }
|
|
.banner { flex-shrink: 0; }
|
|
</style>
|
|
<meta name="theme-color" content="#0e0e10">
|
|
</head>
|
|
<body data-surface="{{.Surface}}" data-base-path="{{.BasePath}}">
|
|
{{if .Banner.Visible}}
|
|
<div class="banner banner-top" style="background:{{.Banner.Background}};color:{{.Banner.Color}};height:var(--banner-h);line-height:var(--banner-h);text-align:center;font-size:12px;font-weight:600;overflow:hidden;">
|
|
{{.Banner.Text}}
|
|
</div>
|
|
{{end}}
|
|
|
|
<div class="surface" id="surface">
|
|
{{if eq .Surface "chat"}}{{template "surface-chat" .}}
|
|
{{else if eq .Surface "admin"}}{{template "surface-admin" .}}
|
|
{{else if eq .Surface "editor"}}{{template "surface-editor" .}}
|
|
{{else if eq .Surface "notes"}}{{template "surface-notes" .}}
|
|
{{else if eq .Surface "settings"}}{{template "surface-settings" .}}
|
|
{{else}}<div style="padding:20px">Unknown surface: {{.Surface}}</div>
|
|
{{end}}
|
|
</div>
|
|
|
|
{{if .Banner.Visible}}
|
|
<div class="banner banner-bottom" style="background:{{.Banner.Background}};color:{{.Banner.Color}};height:var(--banner-h);line-height:var(--banner-h);text-align:center;font-size:12px;font-weight:600;overflow:hidden;">
|
|
{{.Banner.Text}}
|
|
</div>
|
|
{{end}}
|
|
|
|
<script nonce="{{.CSPNonce}}">
|
|
window.__BASE__ = '{{.BasePath}}';
|
|
window.__VERSION__ = '{{.Version}}';
|
|
window.__ENV__ = '{{.Environment}}';
|
|
window.__BRANDING__ = {};
|
|
window.__SURFACE__ = '{{.Surface}}';
|
|
window.__PAGE_DATA__ = {{.Data | toJSON}};
|
|
window.__USER__ = {{.User | toJSON}};
|
|
</script>
|
|
|
|
<script nonce="{{.CSPNonce}}" src="{{.BasePath}}/js/api.js?v={{.Version}}"></script>
|
|
<script nonce="{{.CSPNonce}}" src="{{.BasePath}}/js/events.js?v={{.Version}}"></script>
|
|
<script nonce="{{.CSPNonce}}" src="{{.BasePath}}/js/ui-primitives.js?v={{.Version}}"></script>
|
|
<script nonce="{{.CSPNonce}}" src="{{.BasePath}}/js/pages.js?v={{.Version}}"></script>
|
|
|
|
{{if eq .Surface "chat"}}{{template "scripts-chat" .}}{{end}}
|
|
{{if eq .Surface "admin"}}{{template "scripts-admin" .}}{{end}}
|
|
{{if eq .Surface "editor"}}{{template "scripts-editor" .}}{{end}}
|
|
{{if eq .Surface "notes"}}{{template "scripts-notes" .}}{{end}}
|
|
{{if eq .Surface "settings"}}{{template "scripts-settings" .}}{{end}}
|
|
</body>
|
|
</html>
|
|
{{end}}
|