fix: Fixes some layout issues with footer and sidebar, makes size column in duct-sizing views to be a fixed width, so the tables line up properly.

This commit is contained in:
2026-01-15 09:17:27 -05:00
parent 1b88f81b5f
commit 7471e11bd2
5 changed files with 78 additions and 121 deletions

View File

@@ -21,7 +21,7 @@ extension DuctSizingView {
th { "BTU" }
th { "CFM" }
th { "Velocity" }
th { "Size" }
th(.class("w-[330px]")) { "Size" }
}
}
tbody {
@@ -101,7 +101,7 @@ extension DuctSizingView {
td { Number(room.velocity) }
td {
div(.class("grid grid-cols-3 gap-2")) {
div(.class("grid grid-cols-3 gap-2 w-[330px]")) {
div(.class("label")) { "Calculated" }
div(.class("flex justify-center")) {

View File

@@ -22,7 +22,7 @@ extension DuctSizingView {
th { "Associated Supplies" }
th { "Dsn CFM" }
th { "Velocity" }
th { "Size" }
th(.class("w-[330px]")) { "Size" }
}
}
tbody {
@@ -65,7 +65,7 @@ extension DuctSizingView {
Number(trunk.velocity)
}
td {
div(.class("grid grid-cols-3 gap-4")) {
div(.class("grid grid-cols-3 gap-2 w-[330px]")) {
div(.class("label")) { "Calculated" }
div(.class("flex justify-center")) {
Badge(number: trunk.roundSize, digits: 1)
@@ -97,15 +97,17 @@ extension DuctSizingView {
.attributes(.class("badge-info"))
}
}
div(.class("flex justify-end")) {
div(.class("flex justify-end items-end")) {
div(.class("join")) {
TrashButton()
.attributes(.class("join-item btn-ghost"))
.attributes(
.hx.delete(route: deleteRoute),
.hx.target("closest tr"),
.hx.swap(.outerHTML)
)
if trunk.width != nil {
TrashButton()
.attributes(.class("join-item btn-ghost"))
.attributes(
.hx.delete(route: deleteRoute),
.hx.target("closest tr"),
.hx.swap(.outerHTML)
)
}
EditButton()
.attributes(

View File

@@ -81,23 +81,25 @@ public struct MainPage<Inner: HTML>: SendableHTMLDocument where Inner: Sendable
}
public var body: some HTML {
div(.class("flex flex-col min-h-screen min-w-full")) {
main(.class("grow")) {
div(.class("flex flex-col min-h-screen min-w-full justify-between")) {
main(.class("flex flex-col min-h-screen min-w-full grow mb-auto")) {
inner
}
if displayFooter {
footer(
.class(
"""
footer sm:footer-horizontal footer-center
bg-base-300 text-base-content p-4
"""
)
) {
aside {
p {
"Copyright © \(Date().description.prefix(4)) - All rights reserved by Michael Housh"
div(.class("bottom-0 left-0 bg-error")) {
if displayFooter {
footer(
.class(
"""
footer sm:footer-horizontal footer-center
bg-base-300 text-base-content p-4
"""
)
) {
aside {
p {
"Copyright © \(Date().description.prefix(4)) - All rights reserved by Michael Housh"
}
}
}
}

View File

@@ -31,25 +31,22 @@ struct ProjectView<Inner: HTML>: HTML, Sendable where Inner: Sendable {
}
var body: some HTML {
div(.class("h-screen w-full")) {
div(.class("drawer lg:drawer-open h-full")) {
input(.id("my-drawer-1"), .type(.checkbox), .class("drawer-toggle"))
div(.class("drawer lg:drawer-open")) {
input(.id("my-drawer-1"), .type(.checkbox), .class("drawer-toggle"))
div(.class("drawer-content")) {
Navbar(sidebarToggle: true)
div(.class("p-4")) {
inner
.environment(ProjectViewValue.$projectID, projectID)
}
div(.class("drawer-content overflow-auto")) {
Navbar(sidebarToggle: true)
div(.class("p-4")) {
inner
.environment(ProjectViewValue.$projectID, projectID)
}
Sidebar(
active: activeTab,
projectID: projectID,
completedSteps: completedSteps
)
}
Sidebar(
active: activeTab,
projectID: projectID,
completedSteps: completedSteps
)
}
}
@@ -65,7 +62,7 @@ extension ProjectView {
var body: some HTML {
div(.class("drawer-side is-drawer-close:overflow-visible")) {
div(.class("drawer-side is-drawer-close:overflow-visible grow")) {
label(
.for("my-drawer-1"), .init(name: "aria-label", value: "close sidebar"),
.class("drawer-overlay")
@@ -74,13 +71,13 @@ extension ProjectView {
div(
.class(
"""
flex min-h-full flex-col items-start bg-base-300 text-base-content
flex grow h-full flex-col items-start bg-base-300 text-base-content
is-drawer-close:min-w-[80px] is-drawer-open:max-w-[300px]
"""
)
) {
ul(.class("w-full")) {
ul(.class("w-full grow")) {
li(.class("flex w-full")) {
row(