diff --git a/config/config.go b/config/config.go index 4544050..72827f1 100644 --- a/config/config.go +++ b/config/config.go @@ -47,7 +47,8 @@ func (*AmCLI) Version() string { // AmConfig holds the configuration of the application as read from YAML. type AmConfig struct { Site struct { - Title string `yaml:"title"` + Title string `yaml:"title"` + TopRefresh int `yaml:"topRefresh"` } `yaml:"site"` Database struct { Driver string `yaml:"driver"` diff --git a/config/default.yaml b/config/default.yaml index 80b8325..b0fd42d 100644 --- a/config/default.yaml +++ b/config/default.yaml @@ -8,6 +8,7 @@ # site: title: "Amsterdam Web Communities System" + topRefresh: 300 database: driver: "mysql" dsn: "amsdb:x00yes2k@tcp(localhost)/amsterdam?parseTime=true&loc=Local" diff --git a/top.go b/top.go index 91632e3..a968170 100644 --- a/top.go +++ b/top.go @@ -138,8 +138,10 @@ func TopPage(ctxt ui.AmContext) (string, any, error) { return "string", "Unable to render sideboxes", err } } - ctxt.VarMap().Set("sideboxes", rc) + + // Final data set. + ctxt.VarMap().Set("amsterdam_genRefresh", true) return "framed_template", "top.jet", nil } diff --git a/ui/views/frame.jet b/ui/views/frame.jet index dd05127..cdc0ee9 100644 --- a/ui/views/frame.jet +++ b/ui/views/frame.jet @@ -14,7 +14,9 @@ {{ amsterdam_pageTitle }} - {{ GlobalConfig.Site.Title }} - + {{ if isset(amsterdam_genRefresh) && GlobalConfig.Site.TopRefresh > 0 }} + + {{ end }}