feat: More view changes.

This commit is contained in:
2025-01-07 07:53:32 -05:00
parent f9b58676bb
commit e3f150b32c
5 changed files with 122 additions and 18 deletions

View File

@@ -7,7 +7,10 @@ func routes(_ app: Application) throws {
let credentialsProtected = app.grouped(User.credentialsAuthenticator(), redirectMiddleware)
app.get { req async throws in
try await req.view.render("index", ["title": "HHE - Purchase Orders"])
try await req.view.render(
"index",
Index(showNavLinks: false)
)
}
app.get("login") { req async throws -> View in
@@ -59,6 +62,19 @@ func routes(_ app: Application) throws {
try app.register(collection: ApiController())
}
struct Index: Content {
let title: String
let showNavLinks: Bool
init(
title: String = "HHE - Purchase Orders",
showNavLinks: Bool
) {
self.title = title
self.showNavLinks = showNavLinks
}
}
struct UserForm: Content {
let username: String
let password: String