aboutsummaryrefslogtreecommitdiffstats
path: root/web/command/html/authenticate.go
diff options
context:
space:
mode:
Diffstat (limited to 'web/command/html/authenticate.go')
-rw-r--r--web/command/html/authenticate.go43
1 files changed, 43 insertions, 0 deletions
diff --git a/web/command/html/authenticate.go b/web/command/html/authenticate.go
new file mode 100644
index 0000000..27a2321
--- /dev/null
+++ b/web/command/html/authenticate.go
@@ -0,0 +1,43 @@
+package html
+
+import (
+ . "maragu.dev/gomponents"
+ . "maragu.dev/gomponents/html"
+)
+
+func AuthenticatePage(err string) Node {
+ return page("Authenticate",
+ H1(Text("Welcome to scrapbook")),
+
+ If(err != "", alertError(err)),
+
+ Form(
+ Action("/authenticate"),
+ Method("post"),
+
+ FieldSet(
+ Legend(Text("Authentication")),
+ Label(
+ For("token"),
+ Text("Secret key"),
+ ),
+ Input(
+ ID("token"),
+ Name("token"),
+ ),
+ Span(
+ Class("form-help"),
+ Text("Enter the secret key to continue."),
+ ),
+ ),
+
+ Div(
+ Class("control-group group-right"),
+ Input(
+ Type("submit"),
+ Value("Submit"),
+ ),
+ ),
+ ),
+ )
+}