{{/* The shell of every redesigned page (docs/plans/panel-redesign.md § Three layers): a brick navbar with the wordmark and hover menus, the stamp's perforated edge, the strip of sibling pages, the page, the footer. It is built exactly like the mockups' build.py builds it, and it is the only place besides components.html where sp- classes are written. A page never writes any of it. layout.html is executed with a Frame (components.go): .Shell is what the shell shows, .Page is the page's own data, handed to the page's "content" template. Which entries are visible comes from .Shell (Engine.shell derives it from the role, the feature flags and the user's reach); the paths are written out here, so the menu can be read, and checked against the router (guard_routes_test.go), without running anything. */}} {{/* layout_head is the head of both documents; the stylesheets, in this order, and the two scripts are all a page ever loads. */}} {{define "layout_head"}} {{.Title}} · SelfPost {{/* The tab icon is the stamp's small-size variant — the initials rather than the two-line wordmark, which stops resolving below 32px. The PNG is declared first and the SVG second: a browser takes the last icon whose type it understands, so vector wins wherever it is supported and the raster catches the rest. */}} {{/* Unless told otherwise, htmx injects a stylesheet element of its own into the head for the request-indicator classes. The panel uses no hx-indicator, and that injected element would be the one thing the Content-Security-Policy has to make an exception for, so it is switched off here. */}} {{end}} {{/* layout.html is the signed-in document. Engine.Render uses layout_signed_out instead when there is no user. */}} {{define "layout.html"}} {{template "layout_head" .Shell}} {{template "nav" .Shell}} {{template "subnav" .Shell}}
{{template "content" .Page}} {{/* Appropriate Legal Notices (AGPL-3.0): copyright, how to read the licence, where the Corresponding Source is, and that there is no warranty. The running version is shown signed in only: it is what a backup manifest is checked against on restore, and must not be advertised to the internet. */}}
{{end}} {{/* layout_signed_out is the split brand / form screen of sign-in and setup: the stamp on the brick, the page's own form beside it, and the legal notice without the version. */}} {{define "layout_signed_out"}} {{template "layout_head" .Shell}}
SelfPost

YOUR SMTP. YOUR RULES.

{{template "content" .Page}}

{{.Shell.Copyright}} · License (AGPL-3.0) · Source · No warranty

{{end}} {{/* nav is the navbar and the perforated edge under it (input: Shell). A group with nothing in it for this user is absent; the group of the current page carries sp-current and its current entry is-active. */}} {{define "nav"}} {{end}} {{/* subnav is the strip of sibling pages under the edge (input: Shell): the pages of the current group, the current one marked. A page outside every group (the user menu, the kit page's neighbours) has none. */}} {{define "subnav"}}{{if and .ShowOutbound (eq .Section "outbound")}}
DomainsLog{{if .ShowQueue}}Queue{{end}}{{if .ShowDMARC}}DMARC reports{{end}}
{{else if and .ShowInbound (eq .Section "inbound")}}
Domains
{{else if and .ShowServer (eq .Section "server")}}
HealthSystem logBackupUsersSettings
{{end}}{{end}}