feat: Better modal form using dialog, some forms still need updated to use it effectively.

This commit is contained in:
2026-01-06 10:12:48 -05:00
parent fc12e47b5c
commit 5fcc5b88fa
14 changed files with 161 additions and 130 deletions

View File

@@ -20,9 +20,10 @@ struct RoomsView: HTML, Sendable {
.data("tip", value: "Add room")
) {
button(
.hx.get(route: .project(.detail(projectID, .rooms(.form(dismiss: false))))),
.hx.target("#roomForm"),
.hx.swap(.outerHTML),
// .hx.get(route: .project(.detail(projectID, .rooms(.form(dismiss: false))))),
// .hx.target("#roomForm"),
// .hx.swap(.outerHTML),
.on(.click, "roomForm.showModal()"),
.class("btn btn-primary w-[40px] text-2xl")
) {
"+"
@@ -81,9 +82,10 @@ struct RoomsView: HTML, Sendable {
.attributes(.class("text-error"))
}
td {
Number(room.coolingLoad)
Number(room.coolingTotal)
.attributes(.class("text-success"))
}
// FIX: Add cooling sensible.
td {
Number(room.registerCount)
}
@@ -120,6 +122,6 @@ extension Array where Element == Room {
}
var coolingTotal: Double {
reduce(into: 0) { $0 += $1.coolingLoad }
reduce(into: 0) { $0 += $1.coolingTotal }
}
}