package web
import (
"git.zb-server.de/ZB-Server/uptimesebi/internal/agentapi"
"git.zb-server.de/ZB-Server/uptimesebi/internal/i18n"
)
templ legalLink(l LegalLink) {
if l.External {
{ i18n.T(ctx, LegalTitleID(l.Kind)) }
} else {
{ i18n.T(ctx, LegalTitleID(l.Kind)) }
}
}
// siteFooter links the API documentation and the platform's legal
// documents.
templ siteFooter(links []LegalLink) {
}
templ legalBody(html string) {
@templ.Raw(html)
}
// LegalPage shows a platform legal document.
// LegalPage shows a platform legal document: inside the console for
// signed-in users, with a plain header for everyone else, who must be able
// to read it too.
templ LegalPage(p Page, me *Me, html string) {
if me != nil {
@consoleShell(p, *me) {
@legalBody(html)
}
} else {
@Layout(p) {
@legalBody(html)
}
}
}
// PublicLegalPage shows a legal document of a status page.
templ PublicLegalPage(s agentapi.PageSnapshot, a PublicAssets, kind, html, back string) {
@legalBody(html)
}
// LegalForm is the stored state of one legal document.
type LegalForm struct {
Kind string
URL string
Markdown string
}
// LegalSettingsPage edits legal documents. apiBase plus the kind is the
// endpoint each form saves to.
templ LegalSettingsPage(p Page, me Me, titleID, introID, apiBase, next string, docs []LegalForm) {
@consoleShell(p, me) {
@settingsHeading(titleID, introID)
for _, d := range docs {
@sectionHeading(LegalTitleID(d.Kind))
}
}
}