package web import "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 } templ Layout(p Page) { if p.CSRF != "" { } { i18n.T(ctx, p.TitleID) } ยท uptimesebi { children... } } 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() { }