feat: Begins user profile, adds database model, need to add views / forms.

This commit is contained in:
2026-01-12 13:33:53 -05:00
parent 6416b29627
commit 894bd561ff
16 changed files with 1439 additions and 3411 deletions

View File

@@ -9,10 +9,13 @@ public struct MainPage<Inner: HTML>: SendableHTMLDocument where Inner: Sendable
public var lang: String { "en" }
let inner: Inner
let theme: Theme?
init(
theme: Theme? = nil,
_ inner: () -> Inner
) {
self.theme = theme
self.inner = inner()
}
@@ -54,10 +57,7 @@ public struct MainPage<Inner: HTML>: SendableHTMLDocument where Inner: Sendable
div(.class("h-screen w-full")) {
inner
}
script(.src("https://unpkg.com/lucide@latest")) {}
script {
"lucide.createIcons();"
}
.attributes(.data("theme", value: theme!.rawValue), when: theme != nil)
}
}

View File

@@ -42,10 +42,34 @@ struct Navbar: HTML, Sendable {
}
}
div(.class("flex-none")) {
button(.class("w-fit px-4 py-2")) {
"User Menu"
details(.class("dropdown dropdown-left dropdown-bottom")) {
summary(.class("btn w-fit px-4 py-2")) {
SVG(.circleUser)
}
.navButton()
ul(
.class(
"""
menu dropdown-content bg-base-100
rounded-box z-1 w-fit p-2 shadow-sm
"""
)
) {
li(.class("w-full")) {
// TODO: Save theme to user profile ??
div(.class("flex justify-between p-4 space-x-6")) {
Label("Theme")
input(.type(.checkbox), .class("toggle theme-controller"), .value("light"))
}
}
}
// button(.class("w-fit px-4 py-2")) {
// SVG(.circleUser)
// }
// .navButton()
}
.navButton()
}
}
}

View File

@@ -82,13 +82,6 @@ extension ProjectView {
ul(.class("w-full")) {
// FIX: Move to user profile / settings page.
li(.class("w-full is-drawer-close:hidden")) {
div(.class("flex justify-between p-4")) {
Label("Theme")
input(.type(.checkbox), .class("toggle theme-controller"), .value("light"))
}
}
li(.class("flex w-full")) {
row(

View File

@@ -121,6 +121,7 @@ struct RoomsView: HTML, Sendable {
}
public struct RoomRow: HTML, Sendable {
let room: Room
let shr: Double
@@ -137,7 +138,7 @@ struct RoomsView: HTML, Sendable {
}
public var body: some HTML {
tr(.id("roomRow_\(room.name)")) {
tr(.id("roomRow_\(room.id.idString)")) {
td { room.name }
td {
div(.class("flex justify-center")) {