feat: Begins migrating views from leaf to elementary
This commit is contained in:
31
Sources/App/Views/Navbar.swift
Normal file
31
Sources/App/Views/Navbar.swift
Normal file
@@ -0,0 +1,31 @@
|
||||
import Elementary
|
||||
import ElementaryHTMX
|
||||
|
||||
struct Navbar: HTML {
|
||||
var content: some HTML {
|
||||
div(.class("sidepanel"), .id("sidepanel")) {
|
||||
a(.href("javascript:void(0)"), .class("closebtn"), .on(.click, "closeSidepanel()")) {
|
||||
"x"
|
||||
}
|
||||
a(.hx.get("/purchase-orders?page=1&limit=50"), .hx.target("body"), .hx.pushURL(true)) {
|
||||
"Purchae Orders"
|
||||
}
|
||||
a(.hx.get("/users"), .hx.target("body"), .hx.pushURL(true)) {
|
||||
"Users"
|
||||
}
|
||||
a(.hx.get("/employees"), .hx.target("body"), .hx.pushURL(true)) {
|
||||
"Employees"
|
||||
}
|
||||
a(.hx.get("/vendors"), .hx.target("body"), .hx.pushURL(true)) {
|
||||
"Vendors"
|
||||
}
|
||||
div(.style("border-bottom: 1px solid grey; margin-bottom: 5px;")) {}
|
||||
a(.hx.post("/logout"), .hx.target("#content"), .hx.swap(.outerHTML), .hx.trigger(.event(.click))) {
|
||||
"Logout"
|
||||
}
|
||||
}
|
||||
button(.class("openbtn"), .on(.click, "openSidepanel()")) {
|
||||
img(.src("/images/menu.svg"), .style("width: 30px;, height: 30px;"))
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user