provide settings prior to js rendering

This commit is contained in:
Nazar Kanaev
2021-03-31 14:48:39 +01:00
parent e7b645a68a
commit c74eeff790
3 changed files with 24 additions and 29 deletions

View File

@@ -52,7 +52,10 @@ func (s *Server) handler() http.Handler {
}
func (s *Server) handleIndex(c *router.Context) {
c.HTML(http.StatusOK, assets.Template("index.html"), nil)
c.HTML(http.StatusOK, assets.Template("index.html"), map[string]interface{} {
"settings": s.db.GetSettings(),
"authenticated": s.Username != "" && s.Password != "",
})
}
func (s *Server) handleStatic(c *router.Context) {