Initial commit

This commit is contained in:
2021-10-23 19:59:20 +10:00
commit ba4c9a7d7a
1851 changed files with 1250444 additions and 0 deletions

54
PageController.fs Normal file
View File

@@ -0,0 +1,54 @@
module PageController
open Microsoft.AspNetCore.Http
open Floorplan
open Giraffe
open DredgeFramework
let loadHomePage(): HttpHandler =
let variables = map["title", "Log In"]
let scripts = ["dredgepos.authenticate.js"]
let styles = ["dredgepos.authenticate.css"]
htmlString <| Theme.loadTemplateWithVarsScriptsAndStyles "authenticate" variables scripts styles
let loadFloorplan (ctx: HttpContext) : HttpHandler =
Session.RequireClerkAuthentication ctx
let roomMenu =
getRoomList currentVenue
|> Array.map convertRoomListToLinks
|> String.concat "\n"
let variables = map [
"title", "Floorplan"
"roomMenu", roomMenu
"decorator", Decorations.generateDecorator()
]
let styles = ["tableMap.css"]
let scripts = ["konva.js" ; "dredgepos.floorplan.js"]
let currentClerk = recordToMap <| Session.getCurrentClerk ctx
let arrays = map["clerk", currentClerk]
htmlString <| Theme.loadTemplateWithVarsArraysScriptsAndStyles "tableMap" variables arrays scripts styles
let loadContactPage id =
Session.clerkLogin 1408 |> ignore
Theme.loadTemplate "index"
let getOpenTables() =
let rows = Floorplan.openTables
rows |> jsonEncode
let transferTables() =
Theme.loadTemplate "index"
let mergeTables parent child =
Floorplan.mergeTables parent child |> ignore
"done"
let unmergeTables table =
Floorplan.unmergeTable table |> ignore
"done"