footer: Add a semi-flexible template system

This commit is contained in:
Tom Wiesing 2023-01-06 22:52:47 +01:00
parent bda763725e
commit 021fc3cc7e
No known key found for this signature in database
26 changed files with 239 additions and 208 deletions

View file

@ -56,13 +56,13 @@ type legalContext struct {
AssetsDisclaimer string
}
func (legal *Legal) context(r *http.Request) (legalContext, error) {
return legalContext{
BaseContext: legal.Dependencies.Custom.New(),
LegalNotices: cli.LegalNotices,
func (legal *Legal) context(r *http.Request) (lc legalContext, err error) {
legal.Dependencies.Custom.Update(&lc, r)
CSRFCookie: control.CSRFCookie,
SessionCookie: control.SessionCookie,
AssetsDisclaimer: static.AssetsDisclaimer,
}, nil
lc.LegalNotices = cli.LegalNotices
lc.CSRFCookie = control.CSRFCookie
lc.SessionCookie = control.SessionCookie
lc.AssetsDisclaimer = static.AssetsDisclaimer
return
}

View file

@ -1,9 +1,6 @@
{{ template "_base.html" . }}
{{ define "title" }}Legal{{ end }}
{{ define "header/time" }}
<!-- no header/time -->
{{ end }}
{{ define "header"}}
<!-- no header -->
{{ end }}