signup_templ.go
1// Code generated by templ - DO NOT EDIT.
2
3// templ: version: v0.3.1020
4package pages
5
6//lint:file-ignore SA4006 This context is only used if a nested component is present.
7
8import "github.com/a-h/templ"
9import templruntime "github.com/a-h/templ/runtime"
10
11func Signup(e string) templ.Component {
12 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
13 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
14 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
15 return templ_7745c5c3_CtxErr
16 }
17 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
18 if !templ_7745c5c3_IsBuffer {
19 defer func() {
20 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
21 if templ_7745c5c3_Err == nil {
22 templ_7745c5c3_Err = templ_7745c5c3_BufErr
23 }
24 }()
25 }
26 ctx = templ.InitializeContext(ctx)
27 templ_7745c5c3_Var1 := templ.GetChildren(ctx)
28 if templ_7745c5c3_Var1 == nil {
29 templ_7745c5c3_Var1 = templ.NopComponent
30 }
31 ctx = templ.ClearChildren(ctx)
32 templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
33 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
34 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
35 if !templ_7745c5c3_IsBuffer {
36 defer func() {
37 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
38 if templ_7745c5c3_Err == nil {
39 templ_7745c5c3_Err = templ_7745c5c3_BufErr
40 }
41 }()
42 }
43 ctx = templ.InitializeContext(ctx)
44 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div id=\"form\" class=\"flex flex-col p-10 md:p-50 md:max-w-2/3 mx-auto\"><form class=\"space-y-4 md:space-y-6\" hx-encoding=\"multipart/form-data\" hx-post=\"/signup\" hx-swap=\"outerHTML\" hx-target=\"#form\"><div><label for=\"user\" class=\"block text-sm font-medium\">Email</label><div class=\"italic text-gray-600 text-sm mb-2\">Email is not required but you won't be able to reset your password without it.</div><input type=\"email\" name=\"user\" id=\"user\" autoCapitalize=\"off\" autoComplete=\"off\" class=\"bg-white border border-gray-300 text-gray-900 rounded-lg focus:ring-(--color-orange) focus:border-(--color-orange) block w-full p-2.5\"></div><div><label for=\"handle\" class=\"block text-sm font-medium\">Handle</label><div class=\"italic text-gray-600 text-sm mb-2\"><span>Your handle will appear on your public routes. You can change it later but it must be unique. Allowed characters: </span> <span class=\"not-italic font-mono\">A-Z a-z 0-9 . _ @ - [] ! </span> <span>and at least 3 letters long.</span></div><input type=\"text\" name=\"handle\" id=\"handle\" autoCapitalize=\"off\" autoComplete=\"off\" class=\"bg-white border border-gray-300 text-gray-900 rounded-lg focus:ring-(--color-orange) focus:border-(--color-orange) block w-full p-2.5\"></div><div><label for=\"password\" class=\"block mb-2 text-sm font-medium\">Password</label> <input type=\"password\" name=\"password\" id=\"password\" autoCapitalize=\"off\" autoComplete=\"off\" class=\"bg-white border border-gray-300 text-gray-900 rounded-lg focus:ring-(--color-orange) focus:border-(--color-orange) block w-full p-2.5\"></div><button class=\"w-full text-white bg-[var(--color-orange)] focus:ring-4 focus:outline-none focus:ring-[var(--color-blue)] font-medium rounded-lg text-sm px-5 py-2.5\" type=\"submit\">Sign up</button> ")
45 if templ_7745c5c3_Err != nil {
46 return templ_7745c5c3_Err
47 }
48 if e != "" {
49 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "<div class=\"bg-red-300 text-[var(--color-red)] px-4 py-2 rounded-sm\">")
50 if templ_7745c5c3_Err != nil {
51 return templ_7745c5c3_Err
52 }
53 var templ_7745c5c3_Var3 string
54 templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(e)
55 if templ_7745c5c3_Err != nil {
56 return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/signup.templ`, Line: 65, Col: 77}
57 }
58 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
59 if templ_7745c5c3_Err != nil {
60 return templ_7745c5c3_Err
61 }
62 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</div>")
63 if templ_7745c5c3_Err != nil {
64 return templ_7745c5c3_Err
65 }
66 }
67 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "<div>Already have an account? <a role=\"button\" class=\"text-[var(--color-blue)] cursor-pointer underline decoration-dotted\" href=\"/login\">Log in</a></div></form></div>")
68 if templ_7745c5c3_Err != nil {
69 return templ_7745c5c3_Err
70 }
71 templ_7745c5c3_Err = HTMX().Render(ctx, templ_7745c5c3_Buffer)
72 if templ_7745c5c3_Err != nil {
73 return templ_7745c5c3_Err
74 }
75 return nil
76 })
77 templ_7745c5c3_Err = Layout().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
78 if templ_7745c5c3_Err != nil {
79 return templ_7745c5c3_Err
80 }
81 return nil
82 })
83}
84
85var _ = templruntime.GeneratedTemplate