Update all the shit

This commit is contained in:
Henri Burau
2024-06-07 00:07:29 +02:00
parent ddbfc32fb1
commit 18265f59df
43 changed files with 609 additions and 182 deletions

View File

@ -6,22 +6,23 @@ import (
)
type LoginFormValues struct {
Username string
Password string
Username string
Password string
}
templ LoginForm(formValues LoginFormValues, errors map[string]string) {
@layouts.Base() {
@components.Form(components.FormProps{
Title: "Log into your account",
Action: "/signin",
Method: "post",
Title: "Log into your account",
Action: "/signin",
Method: "post",
SubmitText: "Login",
}) {
<div>
<label for="username" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Username</label>
@components.Input(components.InputProps{
Name: "username",
Type: "text",
Value: formValues.Username,
Error: errors["username"],
Placeholder: "Your username",
@ -31,6 +32,7 @@ templ LoginForm(formValues LoginFormValues, errors map[string]string) {
<label for="password" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Password</label>
@components.Input(components.InputProps{
Name: "password",
Type: "password",
Value: formValues.Password,
Error: errors["password"],
Placeholder: "Your password",

View File

@ -45,12 +45,13 @@ func LoginForm(formValues LoginFormValues, errors map[string]string) templ.Compo
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div><label for=\"username\" class=\"block mb-2 text-sm font-medium text-gray-900 dark:text-white\">Username</label>")
templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = components.Input(components.InputProps{
Name: "username",
Type: "text",
Value: formValues.Username,
Error: errors["username"],
Placeholder: "Your username",
@ -58,12 +59,13 @@ func LoginForm(formValues LoginFormValues, errors map[string]string) templ.Compo
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div><label for=\"password\" class=\"block mb-2 text-sm font-medium text-gray-900 dark:text-white\">Password</label>")
templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 2)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = components.Input(components.InputProps{
Name: "password",
Type: "password",
Value: formValues.Password,
Error: errors["password"],
Placeholder: "Your password",
@ -71,7 +73,7 @@ func LoginForm(formValues LoginFormValues, errors map[string]string) templ.Compo
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 3)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@ -0,0 +1,3 @@
<div><label for=\"username\" class=\"block mb-2 text-sm font-medium text-gray-900 dark:text-white\">Username</label>
</div><div><label for=\"password\" class=\"block mb-2 text-sm font-medium text-gray-900 dark:text-white\">Password</label>
</div>