feat: Adds footer with copyright info.
This commit is contained in:
@@ -26,7 +26,9 @@ struct DuctSizingView: HTML, Sendable {
|
||||
}
|
||||
|
||||
Row {
|
||||
h2(.class("text-2xl font-bold")) { "Trunk Sizes" }
|
||||
h2(.class("text-2xl font-bold")) {
|
||||
"Trunk / Runout Sizes"
|
||||
}
|
||||
|
||||
PlusButton()
|
||||
.attributes(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Elementary
|
||||
import ElementaryHTMX
|
||||
import Foundation
|
||||
import ManualDCore
|
||||
import Styleguide
|
||||
|
||||
@@ -10,11 +11,14 @@ public struct MainPage<Inner: HTML>: SendableHTMLDocument where Inner: Sendable
|
||||
|
||||
let inner: Inner
|
||||
let theme: Theme?
|
||||
let displayFooter: Bool
|
||||
|
||||
init(
|
||||
displayFooter: Bool = true,
|
||||
theme: Theme? = nil,
|
||||
_ inner: () -> Inner
|
||||
) {
|
||||
self.displayFooter = displayFooter
|
||||
self.theme = theme
|
||||
self.inner = inner()
|
||||
}
|
||||
@@ -25,6 +29,12 @@ public struct MainPage<Inner: HTML>: SendableHTMLDocument where Inner: Sendable
|
||||
"""
|
||||
}
|
||||
|
||||
private var keywords: String {
|
||||
"""
|
||||
duct, hvac, duct-design, duct design, manual-d, manual d, design
|
||||
"""
|
||||
}
|
||||
|
||||
public var head: some HTML {
|
||||
meta(.charset(.utf8))
|
||||
meta(.name(.viewport), .content("width=device-width, initial-scale=1.0"))
|
||||
@@ -38,6 +48,7 @@ public struct MainPage<Inner: HTML>: SendableHTMLDocument where Inner: Sendable
|
||||
meta(.content("summary_large_image"), .name("twitter:card"))
|
||||
meta(.content("1536"), .name("og:image:width"))
|
||||
meta(.content("1024"), .name("og:image:height"))
|
||||
meta(.content(keywords), .name(.keywords))
|
||||
script(.src("https://unpkg.com/htmx.org@2.0.8")) {}
|
||||
script(.src("/js/main.js")) {}
|
||||
link(.rel(.stylesheet), .href("/css/output.css"))
|
||||
@@ -70,10 +81,27 @@ public struct MainPage<Inner: HTML>: SendableHTMLDocument where Inner: Sendable
|
||||
}
|
||||
|
||||
public var body: some HTML {
|
||||
div(.class("h-screen w-full")) {
|
||||
div(.class("overflow-auto")) {
|
||||
div(.class("flex flex-col min-h-screen min-w-full")) {
|
||||
main(.class("overflow-auto grow")) {
|
||||
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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.attributes(.data("theme", value: theme?.rawValue ?? "default"), when: theme != nil)
|
||||
}
|
||||
|
||||
@@ -82,7 +82,6 @@ extension ProjectView {
|
||||
|
||||
ul(.class("w-full")) {
|
||||
|
||||
|
||||
li(.class("flex w-full")) {
|
||||
row(
|
||||
title: "Project",
|
||||
|
||||
@@ -72,49 +72,47 @@ struct RoomsView: HTML, Sendable {
|
||||
|
||||
SHRForm(projectID: projectID, sensibleHeatRatio: sensibleHeatRatio)
|
||||
|
||||
div(.class("overflow-x-auto")) {
|
||||
table(.class("table table-zebra text-lg"), .id("roomsTable")) {
|
||||
thead {
|
||||
tr(.class("text-lg font-bold")) {
|
||||
th { "Name" }
|
||||
th {
|
||||
div(.class("flex justify-center")) {
|
||||
"Heating Load"
|
||||
}
|
||||
table(.class("table table-zebra text-lg"), .id("roomsTable")) {
|
||||
thead {
|
||||
tr(.class("text-lg font-bold")) {
|
||||
th { "Name" }
|
||||
th {
|
||||
div(.class("flex justify-center")) {
|
||||
"Heating Load"
|
||||
}
|
||||
th {
|
||||
div(.class("flex justify-center")) {
|
||||
"Cooling Total"
|
||||
}
|
||||
}
|
||||
th {
|
||||
div(.class("flex justify-center")) {
|
||||
"Cooling Total"
|
||||
}
|
||||
th {
|
||||
div(.class("flex justify-center")) {
|
||||
"Cooling Sensible"
|
||||
}
|
||||
}
|
||||
th {
|
||||
div(.class("flex justify-center")) {
|
||||
"Cooling Sensible"
|
||||
}
|
||||
th {
|
||||
div(.class("flex justify-center")) {
|
||||
"Register Count"
|
||||
}
|
||||
}
|
||||
th {
|
||||
div(.class("flex justify-center")) {
|
||||
"Register Count"
|
||||
}
|
||||
th {
|
||||
div(.class("flex justify-end me-2")) {
|
||||
Tooltip("Add Room") {
|
||||
PlusButton()
|
||||
.attributes(
|
||||
.class("btn-ghost mx-auto"),
|
||||
.showModal(id: RoomForm.id())
|
||||
)
|
||||
.attributes(.class("tooltip-left"))
|
||||
}
|
||||
}
|
||||
th {
|
||||
div(.class("flex justify-end me-2")) {
|
||||
Tooltip("Add Room") {
|
||||
PlusButton()
|
||||
.attributes(
|
||||
.class("btn-ghost mx-auto"),
|
||||
.showModal(id: RoomForm.id())
|
||||
)
|
||||
.attributes(.class("tooltip-left"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
tbody {
|
||||
for room in rooms {
|
||||
RoomRow(room: room, shr: sensibleHeatRatio)
|
||||
}
|
||||
}
|
||||
tbody {
|
||||
for room in rooms {
|
||||
RoomRow(room: room, shr: sensibleHeatRatio)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user