feat: Begins vendor views

This commit is contained in:
2025-01-15 16:37:18 -05:00
parent 24570e7191
commit 6f2e87e886
13 changed files with 199 additions and 301 deletions

View File

@@ -1,6 +1,7 @@
import Elementary
import ElementaryHTMX
// Form used to login or create a new user.
struct UserForm: HTML, Sendable {
let context: Context
@@ -27,25 +28,31 @@ struct UserForm: HTML, Sendable {
value: "if(event.detail.successful) this.reset(); toggleContent('float');"
)
) {
input(.type(.text), .id("username"), .name("username"), .placeholder("Username"), .autofocus, .required)
br()
div(.class("row")) {
input(.type(.text), .id("username"), .name("username"), .placeholder("Username"), .autofocus, .required)
}
if context.showEmailInput {
input(.type(.email), .id("email"), .name("email"), .placeholder("Email"), .required)
br()
div(.class("row")) {
input(.type(.email), .id("email"), .name("email"), .placeholder("Email"), .required)
}
}
div(.class("row")) {
input(.type(.password), .id("password"), .name("password"), .placeholder("Password"), .required)
}
input(.type(.password), .id("password"), .name("password"), .placeholder("Password"), .required)
br()
if context.showConfirmPassword {
input(
.type(.password),
.id("confirmPassword"),
.name("confirmPassword"),
.placeholder("Confirm Password"),
.required
)
br()
div(.class("row")) {
input(
.type(.password),
.id("confirmPassword"),
.name("confirmPassword"),
.placeholder("Confirm Password"),
.required
)
}
}
div(.class("row")) {
button(.type(.submit), .class("btn-primary")) { context.buttonLabel }
}
input(.type(.submit), .value(context.buttonLabel))
}
}