aboutsummaryrefslogtreecommitdiffstats
path: root/web/command/html/authenticate.go
blob: c0775296c1ad4a158a1a773b8d50b0dcd6a6d277 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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"),
					Type("password"),
				),
				Span(
					Class("form-help"),
					Text("Enter the secret key to continue."),
				),
			),

			Div(
				Class("control-group group-right"),
				Input(
					Type("submit"),
					Value("Submit"),
				),
			),
		),
	)
}