From 4e029fb83a1e70495330eaac94981a97de24682e Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 26 Jan 2025 00:04:38 +0100 Subject: feat(webui): bootstrap a proper UI --- pkg/webui/login.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg/webui/login.go') diff --git a/pkg/webui/login.go b/pkg/webui/login.go index 8444e2c..6f688c1 100644 --- a/pkg/webui/login.go +++ b/pkg/webui/login.go @@ -14,6 +14,7 @@ import ( var loginTemplate = template.Must(template.ParseFS(htmlFS, "html/base.html", "html/login.html")) type loginPage struct { + Page Forbidden bool Username string } @@ -28,7 +29,9 @@ func handleLoginGET() http.Handler { return } - render(w, loginTemplate, http.StatusOK, loginPage{}) + render(w, loginTemplate, http.StatusOK, loginPage{ + Page: Page{Title: "Login", Section: "login"}, + }) }) } @@ -36,6 +39,7 @@ func handleLoginPOST(db *database.DB) http.Handler { var validUsername = regexp.MustCompile(`^[a-zA-Z]\w*$`) renderForbidden := func(w http.ResponseWriter, username string) { render(w, loginTemplate, http.StatusForbidden, loginPage{ + Page: Page{Title: "Login", Section: "login"}, Forbidden: true, Username: username, }) -- cgit v1.2.3