1
|
|
|
// Code generated by templ - DO NOT EDIT. |
2
|
|
|
|
3
|
|
|
// templ: version: v0.2.598 |
4
|
|
|
package components |
5
|
|
|
|
6
|
|
|
//lint:file-ignore SA4006 This context is only used if a nested component is present. |
7
|
|
|
|
8
|
|
|
import "github.com/a-h/templ" |
9
|
|
|
import "context" |
10
|
|
|
import "io" |
11
|
|
|
import "bytes" |
12
|
|
|
|
13
|
|
|
func LoginComponent() templ.Component { |
14
|
|
|
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { |
15
|
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) |
16
|
|
|
if !templ_7745c5c3_IsBuffer { |
17
|
|
|
templ_7745c5c3_Buffer = templ.GetBuffer() |
18
|
|
|
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) |
19
|
|
|
} |
20
|
|
|
ctx = templ.InitializeContext(ctx) |
21
|
|
|
templ_7745c5c3_Var1 := templ.GetChildren(ctx) |
22
|
|
|
if templ_7745c5c3_Var1 == nil { |
23
|
|
|
templ_7745c5c3_Var1 = templ.NopComponent |
24
|
|
|
} |
25
|
|
|
ctx = templ.ClearChildren(ctx) |
26
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"flex flex-col gap-4 p-4 md:p-8\" data-testid=\"loginComponent\"><form hx-post=\"/login\" hx-swap=\"beforeend\"><div class=\"\"><label class=\"label flex-row\"><span id=\"email-error\" class=\"label-text\">Email</span></label> <input class=\"input-bordered input w-full transition duration-100\" placeholder=\"Enter your email\" type=\"email\" name=\"email\" required></div><span class=\"text-xs text-gray-500\">We'll never share your email with anyone else.</span><div class=\"\"><label class=\"label\"><span id=\"password-error\" class=\"label-text\">Password</span></label> <input class=\"input-bordered input w-full transition duration-100\" placeholder=\"Enter your password\" type=\"password\" name=\"password\" required></div><span class=\"text-xs text-gray-500\">We recommend using a strong password.</span><div class=\"pt-6\"><button class=\"btn-primary btn transition duration-100 w-full\" hx-disabled-elt=\"this\" type=\"post\">Login</button></div></form></div>") |
27
|
|
|
if templ_7745c5c3_Err != nil { |
28
|
|
|
return templ_7745c5c3_Err |
29
|
|
|
} |
30
|
|
|
if !templ_7745c5c3_IsBuffer { |
31
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) |
32
|
|
|
} |
33
|
|
|
return templ_7745c5c3_Err |
34
|
|
|
}) |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
func EmailError(err string) templ.Component { |
38
|
|
|
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { |
39
|
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) |
40
|
|
|
if !templ_7745c5c3_IsBuffer { |
41
|
|
|
templ_7745c5c3_Buffer = templ.GetBuffer() |
42
|
|
|
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) |
43
|
|
|
} |
44
|
|
|
ctx = templ.InitializeContext(ctx) |
45
|
|
|
templ_7745c5c3_Var2 := templ.GetChildren(ctx) |
46
|
|
|
if templ_7745c5c3_Var2 == nil { |
47
|
|
|
templ_7745c5c3_Var2 = templ.NopComponent |
48
|
|
|
} |
49
|
|
|
ctx = templ.ClearChildren(ctx) |
50
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"email-error\" hx-swap-oob=\"true\" class=\"text-red-500\">Email - ") |
51
|
|
|
if templ_7745c5c3_Err != nil { |
52
|
|
|
return templ_7745c5c3_Err |
53
|
|
|
} |
54
|
|
|
var templ_7745c5c3_Var3 string |
55
|
|
|
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(err) |
56
|
|
|
if templ_7745c5c3_Err != nil { |
57
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/v2/views/components/login.component.templ`, Line: 49, Col: 76} |
58
|
|
|
} |
59
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) |
60
|
|
|
if templ_7745c5c3_Err != nil { |
61
|
|
|
return templ_7745c5c3_Err |
62
|
|
|
} |
63
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>") |
64
|
|
|
if templ_7745c5c3_Err != nil { |
65
|
|
|
return templ_7745c5c3_Err |
66
|
|
|
} |
67
|
|
|
if !templ_7745c5c3_IsBuffer { |
68
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) |
69
|
|
|
} |
70
|
|
|
return templ_7745c5c3_Err |
71
|
|
|
}) |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
func PasswordError(err string) templ.Component { |
75
|
|
|
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { |
76
|
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) |
77
|
|
|
if !templ_7745c5c3_IsBuffer { |
78
|
|
|
templ_7745c5c3_Buffer = templ.GetBuffer() |
79
|
|
|
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) |
80
|
|
|
} |
81
|
|
|
ctx = templ.InitializeContext(ctx) |
82
|
|
|
templ_7745c5c3_Var4 := templ.GetChildren(ctx) |
83
|
|
|
if templ_7745c5c3_Var4 == nil { |
84
|
|
|
templ_7745c5c3_Var4 = templ.NopComponent |
85
|
|
|
} |
86
|
|
|
ctx = templ.ClearChildren(ctx) |
87
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"password-error\" hx-swap-oob=\"true\" class=\"text-red-500\">Password - ") |
88
|
|
|
if templ_7745c5c3_Err != nil { |
89
|
|
|
return templ_7745c5c3_Err |
90
|
|
|
} |
91
|
|
|
var templ_7745c5c3_Var5 string |
92
|
|
|
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(err) |
93
|
|
|
if templ_7745c5c3_Err != nil { |
94
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/v2/views/components/login.component.templ`, Line: 53, Col: 82} |
95
|
|
|
} |
96
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) |
97
|
|
|
if templ_7745c5c3_Err != nil { |
98
|
|
|
return templ_7745c5c3_Err |
99
|
|
|
} |
100
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>") |
101
|
|
|
if templ_7745c5c3_Err != nil { |
102
|
|
|
return templ_7745c5c3_Err |
103
|
|
|
} |
104
|
|
|
if !templ_7745c5c3_IsBuffer { |
105
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) |
106
|
|
|
} |
107
|
|
|
return templ_7745c5c3_Err |
108
|
|
|
}) |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
func LoginError(err string) templ.Component { |
112
|
|
|
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { |
113
|
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) |
114
|
|
|
if !templ_7745c5c3_IsBuffer { |
115
|
|
|
templ_7745c5c3_Buffer = templ.GetBuffer() |
116
|
|
|
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) |
117
|
|
|
} |
118
|
|
|
ctx = templ.InitializeContext(ctx) |
119
|
|
|
templ_7745c5c3_Var6 := templ.GetChildren(ctx) |
120
|
|
|
if templ_7745c5c3_Var6 == nil { |
121
|
|
|
templ_7745c5c3_Var6 = templ.NopComponent |
122
|
|
|
} |
123
|
|
|
ctx = templ.ClearChildren(ctx) |
124
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"email-error\" hx-swap-oob=\"true\" class=\"text-red-500\">Email - ") |
125
|
|
|
if templ_7745c5c3_Err != nil { |
126
|
|
|
return templ_7745c5c3_Err |
127
|
|
|
} |
128
|
|
|
var templ_7745c5c3_Var7 string |
129
|
|
|
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(err) |
130
|
|
|
if templ_7745c5c3_Err != nil { |
131
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/v2/views/components/login.component.templ`, Line: 57, Col: 76} |
132
|
|
|
} |
133
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) |
134
|
|
|
if templ_7745c5c3_Err != nil { |
135
|
|
|
return templ_7745c5c3_Err |
136
|
|
|
} |
137
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div id=\"password-error\" hx-swap-oob=\"true\" class=\"text-red-500\">Password - ") |
138
|
|
|
if templ_7745c5c3_Err != nil { |
139
|
|
|
return templ_7745c5c3_Err |
140
|
|
|
} |
141
|
|
|
var templ_7745c5c3_Var8 string |
142
|
|
|
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(err) |
143
|
|
|
if templ_7745c5c3_Err != nil { |
144
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/v2/views/components/login.component.templ`, Line: 58, Col: 82} |
145
|
|
|
} |
146
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) |
147
|
|
|
if templ_7745c5c3_Err != nil { |
148
|
|
|
return templ_7745c5c3_Err |
149
|
|
|
} |
150
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>") |
151
|
|
|
if templ_7745c5c3_Err != nil { |
152
|
|
|
return templ_7745c5c3_Err |
153
|
|
|
} |
154
|
|
|
if !templ_7745c5c3_IsBuffer { |
155
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) |
156
|
|
|
} |
157
|
|
|
return templ_7745c5c3_Err |
158
|
|
|
}) |
159
|
|
|
} |
160
|
|
|
|