Moved to Giraffe View Engine
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
module DredgePos.Authenticate.Controller
|
||||
|
||||
open Giraffe
|
||||
open DredgeFramework
|
||||
open Microsoft.AspNetCore.Http
|
||||
open DredgePos.Global.Controller
|
||||
|
||||
let loadAuthenticatePage (): HttpHandler =
|
||||
let variables = map ["title", "Log In"]
|
||||
let scripts = ["dredgepos.authenticate.js"]
|
||||
let styles = ["dredgepos.authenticate.css"]
|
||||
let loadAuthenticatePage =
|
||||
let scripts = [|"dredgepos.authenticate.js"|] |> addDefaultScripts
|
||||
let styles = [|"dredgepos.authenticate.css"|] |> addDefaultStyles
|
||||
let metaTags = [|"viewport", "user-scalable = no, initial-scale=0.8,maximum-scale=0.8 ,shrink-to-fit=yes"|] |> addDefaultMetaTags
|
||||
|
||||
Theme.loadTemplateWithVarsScriptsAndStyles "authenticate" variables scripts styles
|
||||
|> htmlString
|
||||
View.index scripts styles metaTags
|
||||
|
||||
let loginWithLoginCode (context: HttpContext) (login_code: int) =
|
||||
if Model.clerkLogin login_code context then ajaxSuccess "success"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
open Saturn
|
||||
open Giraffe
|
||||
|
||||
let homepage = (warbler (fun _ -> Controller.loadAuthenticatePage() ))
|
||||
let homepage = (warbler (fun _ -> htmlView Controller.loadAuthenticatePage ))
|
||||
let handlePostRoute<'a> handlerFunction post next ctx = json (handlerFunction ctx post) next ctx
|
||||
|
||||
let pipeline = pipeline{
|
||||
|
||||
10
Authenticate/View.fs
Normal file
10
Authenticate/View.fs
Normal file
@@ -0,0 +1,10 @@
|
||||
module DredgePos.Authenticate.View
|
||||
|
||||
open DredgePos.Global.View
|
||||
open Giraffe.ViewEngine
|
||||
|
||||
let content = div [_id "authenticator"] []
|
||||
|
||||
let index scripts styles metaTags = HtmlPage "Floorplan" (GetScripts scripts) (GetStyles styles) (GetMetaTags metaTags) [|content|]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user