feat-WIP: Style updates, new form inputs.
This commit is contained in:
@@ -29,7 +29,7 @@ struct EquipmentInfoForm: HTML, Sendable {
|
||||
ModalForm(id: Self.id, dismiss: dismiss) {
|
||||
h1(.class("text-3xl font-bold pb-6 ps-2")) { "Equipment Info" }
|
||||
form(
|
||||
.class("space-y-4 p-4"),
|
||||
.class("grid grid-cols-1 gap-4"),
|
||||
equipmentInfo != nil
|
||||
? .hx.patch(route)
|
||||
: .hx.post(route),
|
||||
@@ -42,27 +42,40 @@ struct EquipmentInfoForm: HTML, Sendable {
|
||||
input(.class("hidden"), .name("id"), .value("\(equipmentInfo.id)"))
|
||||
}
|
||||
|
||||
div {
|
||||
label(.for("staticPressure")) { "Static Pressure" }
|
||||
Input(id: "staticPressure", placeholder: "Static pressure")
|
||||
.attributes(
|
||||
.type(.number), .value(staticPressure), .min("0"), .max("1.0"), .step("0.1")
|
||||
)
|
||||
}
|
||||
div {
|
||||
label(.for("heatingCFM")) { "Heating CFM" }
|
||||
Input(id: "heatingCFM", placeholder: "CFM")
|
||||
.attributes(.type(.number), .min("0"), .value(equipmentInfo?.heatingCFM))
|
||||
}
|
||||
div {
|
||||
label(.for("coolingCFM")) { "Cooling CFM" }
|
||||
Input(id: "coolingCFM", placeholder: "CFM")
|
||||
.attributes(.type(.number), .min("0"), .value(equipmentInfo?.coolingCFM))
|
||||
}
|
||||
div {
|
||||
SubmitButton(title: "Save")
|
||||
.attributes(.class("btn-block"))
|
||||
}
|
||||
LabeledInput(
|
||||
"Static Pressure",
|
||||
.name("staticPressure"),
|
||||
.type(.number),
|
||||
.value(staticPressure),
|
||||
.min("0"),
|
||||
.max("1.0"),
|
||||
.step("0.1"),
|
||||
.required
|
||||
)
|
||||
|
||||
LabeledInput(
|
||||
"Heating CFM",
|
||||
.name("heatingCFM"),
|
||||
.type(.number),
|
||||
.value(equipmentInfo?.heatingCFM),
|
||||
.placeholder("1000"),
|
||||
.min("0"),
|
||||
.required,
|
||||
.autofocus
|
||||
)
|
||||
|
||||
LabeledInput(
|
||||
"Cooling CFM",
|
||||
.name("coolingCFM"),
|
||||
.type(.number),
|
||||
.value(equipmentInfo?.coolingCFM),
|
||||
.placeholder("1000"),
|
||||
.min("0"),
|
||||
.required
|
||||
)
|
||||
|
||||
SubmitButton(title: "Save")
|
||||
.attributes(.class("btn-block my-6"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,12 +8,12 @@ struct EquipmentInfoView: HTML, Sendable {
|
||||
|
||||
var body: some HTML {
|
||||
div(
|
||||
.class("space-y-4 p-4"),
|
||||
.class("space-y-4"),
|
||||
.id("equipmentInfo")
|
||||
) {
|
||||
|
||||
Row {
|
||||
h1(.class("text-2xl font-bold")) { "Equipment Info" }
|
||||
PageTitle { "Equipment Info" }
|
||||
|
||||
Tooltip("Edit equipment info") {
|
||||
EditButton()
|
||||
@@ -29,16 +29,28 @@ struct EquipmentInfoView: HTML, Sendable {
|
||||
table(.class("table table-zebra")) {
|
||||
tbody(.class("text-lg")) {
|
||||
tr {
|
||||
td { Label("Static Pressure") }
|
||||
td { Number(equipmentInfo.staticPressure) }
|
||||
td { span { "Static Pressure" } }
|
||||
td {
|
||||
div(.class("flex justify-end")) {
|
||||
Number(equipmentInfo.staticPressure)
|
||||
}
|
||||
}
|
||||
}
|
||||
tr {
|
||||
td { Label("Heating CFM") }
|
||||
td { Number(equipmentInfo.heatingCFM) }
|
||||
td { span { "Heating CFM" } }
|
||||
td {
|
||||
div(.class("flex justify-end")) {
|
||||
Number(equipmentInfo.heatingCFM)
|
||||
}
|
||||
}
|
||||
}
|
||||
tr {
|
||||
td { Label("Cooling CFM") }
|
||||
td { Number(equipmentInfo.coolingCFM) }
|
||||
td { span { "Cooling CFM" } }
|
||||
td {
|
||||
div(.class("flex justify-end")) {
|
||||
Number(equipmentInfo.coolingCFM)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user