t2/views/auth/login_form.templ

44 lines
1.1 KiB
Plaintext

package auth
import (
"gitea.henriburau.de/haw-lan/cod4watcher/views/layouts"
"gitea.henriburau.de/haw-lan/cod4watcher/views/components"
)
type LoginFormValues struct {
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",
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",
})
</div>
<div>
<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",
})
</div>
}
}
}