diff --git a/app.go b/app.go index 8aeedce..6bda838 100644 --- a/app.go +++ b/app.go @@ -289,6 +289,7 @@ func pageForReq(app *App, r *http.Request) page.StaticPage { p.Username = u.Username } } + p.CanViewReader = !app.cfg.App.Private || u != nil return p } diff --git a/page/page.go b/page/page.go index 4560382..2af5322 100644 --- a/page/page.go +++ b/page/page.go @@ -23,10 +23,11 @@ type StaticPage struct { HeaderNav bool // Request values - Path string - Username string - Values map[string]string - Flashes []string + Path string + Username string + Values map[string]string + Flashes []string + CanViewReader bool } // SanitizeHost alters the StaticPage to contain a real hostname. This is diff --git a/templates/base.tmpl b/templates/base.tmpl index 01ead5b..775dac9 100644 --- a/templates/base.tmpl +++ b/templates/base.tmpl @@ -18,7 +18,7 @@ diff --git a/templates/include/footer.tmpl b/templates/include/footer.tmpl index 252699d..32a7e68 100644 --- a/templates/include/footer.tmpl +++ b/templates/include/footer.tmpl @@ -16,7 +16,7 @@