package web import ( "strconv" "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n" ) // Page carries what every rendered page needs besides its own content. type Page struct { TitleID string CSRF string Languages []string // ErrorID and NoticeID name catalog messages shown above the content, // typically after a redirect back from an SSO flow. ErrorID string NoticeID string // Legal links the platform's legal notice and privacy policy. Legal []LegalLink // RefreshSeconds reloads pages that show live state. RefreshSeconds int } templ Layout(p Page) { if p.CSRF != "" { } if p.RefreshSeconds > 0 { } { i18n.T(ctx, p.TitleID) } ยท uptimesebi
{ children... }
@legalFooter(p.Legal) } templ languageSwitch(langs []string) { for _, l := range langs { if l == i18n.Lang(ctx) { { l } } else { } } } templ authShell(p Page) { @Layout(p) {

uptimesebi

@languageSwitch(p.Languages)

{ i18n.T(ctx, p.TitleID) }

@flash(p) { children... }
} } templ field(label, name, typ, autocomplete string, required bool) { } templ submit(label string) { } templ flash(p Page) { if p.ErrorID != "" {

{ i18n.T(ctx, p.ErrorID) }

} if p.NoticeID != "" {

{ i18n.T(ctx, p.NoticeID) }

} } templ formError() { }