aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/html/password.go
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.net>2026-03-19 17:14:20 +0000
committerLeonardo Bishop <me@leonardobishop.net>2026-03-19 17:14:20 +0000
commit66bd5d2f7fd84eec39d69f4a8f5c435fc978804f (patch)
tree20bfd8637cce28750b4a66bdd9aa47cb9831308b /pkg/html/password.go
parent60cd7875c2c9ee595012078a3ba8f13b71c73dc9 (diff)
Add site passwordsHEADmaster
Diffstat (limited to 'pkg/html/password.go')
-rw-r--r--pkg/html/password.go47
1 files changed, 47 insertions, 0 deletions
diff --git a/pkg/html/password.go b/pkg/html/password.go
new file mode 100644
index 0000000..ba23a06
--- /dev/null
+++ b/pkg/html/password.go
@@ -0,0 +1,47 @@
+package html
+
+import (
+ "net/url"
+
+ . "github.com/LMBishop/scrapbook/web/skeleton"
+ . "maragu.dev/gomponents"
+ . "maragu.dev/gomponents/html"
+)
+
+func AuthenticateSitePage(err, redirect, siteName string) Node {
+ return Page("Authenticate",
+ H1(Text("A password is required to visit this site")),
+
+ If(err != "", AlertError(err)),
+
+ Form(
+ Action("/authenticate?redirect="+url.QueryEscape(redirect)),
+ Method("post"),
+
+ FieldSet(
+ Legend(Text("Authentication")),
+ Label(
+ For("password"),
+ Text("Password"),
+ ),
+ Input(
+ ID("password"),
+ Name("password"),
+ Type("password"),
+ ),
+ Span(
+ Class("form-help"),
+ Text("Enter the password to continue."),
+ ),
+ ),
+
+ Div(
+ Class("control-group group-right"),
+ Input(
+ Type("submit"),
+ Value("Submit"),
+ ),
+ ),
+ ),
+ )
+}