feat: Style updates.
This commit is contained in:
@@ -7,51 +7,95 @@ struct ProjectDetail: HTML, Sendable {
|
||||
let project: Project
|
||||
|
||||
var body: some HTML {
|
||||
div(
|
||||
.class(
|
||||
"""
|
||||
border border-gray-200 rounded-lg shadow-lg space-y-4 p-4 m-4
|
||||
"""
|
||||
)
|
||||
) {
|
||||
div {
|
||||
Row {
|
||||
h1(.class("text-2xl font-bold")) { "Project" }
|
||||
EditButton()
|
||||
.attributes(
|
||||
.class("btn-ghost"),
|
||||
.on(.click, "projectForm.showModal()")
|
||||
)
|
||||
}
|
||||
|
||||
Row {
|
||||
Label("Name")
|
||||
span { project.name }
|
||||
div(.class("overflow-x-auto")) {
|
||||
table(.class("table table-zebra text-lg")) {
|
||||
tbody {
|
||||
tr {
|
||||
td { Label("Name") }
|
||||
td { project.name }
|
||||
}
|
||||
tr {
|
||||
td { Label("Street Address") }
|
||||
td { project.streetAddress }
|
||||
}
|
||||
tr {
|
||||
td { Label("City") }
|
||||
td { project.city }
|
||||
}
|
||||
tr {
|
||||
td { Label("State") }
|
||||
td { project.state }
|
||||
}
|
||||
tr {
|
||||
td { Label("Zip") }
|
||||
td { project.zipCode }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.attributes(.class("border-b border-gray-200"))
|
||||
|
||||
Row {
|
||||
Label("Address")
|
||||
span { project.streetAddress }
|
||||
}
|
||||
.attributes(.class("border-b border-gray-200"))
|
||||
|
||||
Row {
|
||||
Label("City")
|
||||
span { project.city }
|
||||
}
|
||||
.attributes(.class("border-b border-gray-200"))
|
||||
|
||||
Row {
|
||||
Label("State")
|
||||
span { project.state }
|
||||
}
|
||||
.attributes(.class("border-b border-gray-200"))
|
||||
|
||||
Row {
|
||||
Label("Zip")
|
||||
span { project.zipCode }
|
||||
}
|
||||
ProjectForm(dismiss: true, project: project)
|
||||
}
|
||||
|
||||
ProjectForm(dismiss: true, project: project)
|
||||
}
|
||||
|
||||
// var body: some HTML {
|
||||
// div(
|
||||
// .class(
|
||||
// """
|
||||
// space-y-4 p-4 m-4
|
||||
// """
|
||||
// )
|
||||
// ) {
|
||||
// Row {
|
||||
// h1(.class("text-2xl font-bold")) { "Project" }
|
||||
// EditButton()
|
||||
// .attributes(
|
||||
// .class("btn-ghost"),
|
||||
// .on(.click, "projectForm.showModal()")
|
||||
// )
|
||||
// }
|
||||
//
|
||||
// Row {
|
||||
// Label("Name")
|
||||
// span { project.name }
|
||||
// }
|
||||
// .attributes(.class("border-b border-gray-200"))
|
||||
//
|
||||
// Row {
|
||||
// Label("Address")
|
||||
// span { project.streetAddress }
|
||||
// }
|
||||
// .attributes(.class("border-b border-gray-200"))
|
||||
//
|
||||
// Row {
|
||||
// Label("City")
|
||||
// span { project.city }
|
||||
// }
|
||||
// .attributes(.class("border-b border-gray-200"))
|
||||
//
|
||||
// Row {
|
||||
// Label("State")
|
||||
// span { project.state }
|
||||
// }
|
||||
// .attributes(.class("border-b border-gray-200"))
|
||||
//
|
||||
// Row {
|
||||
// Label("Zip")
|
||||
// span { project.zipCode }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// ProjectForm(dismiss: true, project: project)
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,14 @@ struct ProjectView: HTML, Sendable {
|
||||
} onSuccess: { project in
|
||||
ProjectDetail(project: project)
|
||||
}
|
||||
case .equipment:
|
||||
await resultView(projectID) {
|
||||
try await database.equipment.fetch(projectID)
|
||||
} onSuccess: { equipment in
|
||||
EquipmentInfoView(equipmentInfo: equipment, projectID: projectID)
|
||||
}
|
||||
// FIX:
|
||||
// div { "Fix Me" }
|
||||
case .rooms:
|
||||
await resultView(projectID) {
|
||||
try await (
|
||||
@@ -179,6 +187,16 @@ extension ProjectView {
|
||||
.attributes(.data("active", value: "true"), when: active == .rooms)
|
||||
}
|
||||
|
||||
li(.class("flex w-full")) {
|
||||
row(
|
||||
title: "Equipment",
|
||||
icon: .fan,
|
||||
route: .project(.detail(projectID, .equipment(.index))),
|
||||
isComplete: completedSteps.equipmentInfo
|
||||
)
|
||||
.attributes(.data("active", value: "true"), when: active == .equipment)
|
||||
}
|
||||
|
||||
li(.class("w-full")) {
|
||||
// Tooltip("Equivalent Lengths", position: .right) {
|
||||
row(
|
||||
@@ -235,6 +253,7 @@ extension ProjectView {
|
||||
"""
|
||||
),
|
||||
.hx.get(href),
|
||||
.hx.pushURL(true),
|
||||
.hx.target("body"),
|
||||
.hx.swap(.outerHTML)
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user