Basic functionality
This commit is contained in:
41
views/auth/login_form.templ
Normal file
41
views/auth/login_form.templ
Normal file
@ -0,0 +1,41 @@
|
||||
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",
|
||||
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",
|
||||
Value: formValues.Password,
|
||||
Error: errors["password"],
|
||||
Placeholder: "Your password",
|
||||
})
|
||||
</div>
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user