feat: More view changes.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user