Moved to Giraffe View Engine

This commit is contained in:
2022-02-22 15:22:32 +10:00
parent b5a2514495
commit cb58262507
51 changed files with 284 additions and 1379 deletions

View File

@@ -1,16 +1,15 @@
module DredgePos.Authenticate.Controller module DredgePos.Authenticate.Controller
open Giraffe
open DredgeFramework open DredgeFramework
open Microsoft.AspNetCore.Http open Microsoft.AspNetCore.Http
open DredgePos.Global.Controller
let loadAuthenticatePage (): HttpHandler = let loadAuthenticatePage =
let variables = map ["title", "Log In"] let scripts = [|"dredgepos.authenticate.js"|] |> addDefaultScripts
let scripts = ["dredgepos.authenticate.js"] let styles = [|"dredgepos.authenticate.css"|] |> addDefaultStyles
let styles = ["dredgepos.authenticate.css"] 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 View.index scripts styles metaTags
|> htmlString
let loginWithLoginCode (context: HttpContext) (login_code: int) = let loginWithLoginCode (context: HttpContext) (login_code: int) =
if Model.clerkLogin login_code context then ajaxSuccess "success" if Model.clerkLogin login_code context then ajaxSuccess "success"

View File

@@ -3,7 +3,7 @@
open Saturn open Saturn
open Giraffe 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 handlePostRoute<'a> handlerFunction post next ctx = json (handlerFunction ctx post) next ctx
let pipeline = pipeline{ let pipeline = pipeline{

10
Authenticate/View.fs Normal file
View 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|]

View File

@@ -2,7 +2,6 @@
open System.Collections.Generic open System.Collections.Generic
open System.Globalization open System.Globalization
open FSharp.Data.Sql
open System open System
open System.Drawing open System.Drawing
open System.IO open System.IO
@@ -35,8 +34,9 @@ let EnumerableToArray (enumerable: IEnumerable<'T>) = enumerable.ToArray()
let getFileExtension (file: string) = Path.GetExtension file let getFileExtension (file: string) = Path.GetExtension file
let GetFileContents (file: string) = File.ReadAllText file let GetFileContents = File.ReadAllText
let GetFileName (file: string) = Path.GetFileName file let GetFileName (file: string) = Path.GetFileName file
let FileExists = File.Exists
let length (variable: 'T[]) = variable.Length let length (variable: 'T[]) = variable.Length
let first (array: 'a[]) = array[0] let first (array: 'a[]) = array[0]

View File

@@ -13,15 +13,21 @@
<Compile Include="Core\Language.module.fs" /> <Compile Include="Core\Language.module.fs" />
<Compile Include="Core\Theme.module.fs" /> <Compile Include="Core\Theme.module.fs" />
<Compile Include="Printer.module.fs" /> <Compile Include="Printer.module.fs" />
<Compile Include="Global\View.fs" />
<Compile Include="Global\Controller.fs" />
<Compile Include="Global\Router.fs" />
<Compile Include="Entities\Floorplan_Decorations\Model.fs" /> <Compile Include="Entities\Floorplan_Decorations\Model.fs" />
<Compile Include="Entities\Floorplan_Decorations\View.fs" />
<Compile Include="Entities\Floorplan_Decorations\Controller.fs" /> <Compile Include="Entities\Floorplan_Decorations\Controller.fs" />
<Compile Include="Entities\Floorplan_Decorations\Router.fs" /> <Compile Include="Entities\Floorplan_Decorations\Router.fs" />
<Compile Include="Authenticate\Model.fs" /> <Compile Include="Authenticate\Model.fs" />
<Compile Include="Authenticate\View.fs" />
<Compile Include="Authenticate\Controller.fs" /> <Compile Include="Authenticate\Controller.fs" />
<Compile Include="Authenticate\Router.fs" /> <Compile Include="Authenticate\Router.fs" />
<Compile Include="Ajax\Controller.fs" /> <Compile Include="Ajax\Controller.fs" />
<Compile Include="Ajax\Router.fs" /> <Compile Include="Ajax\Router.fs" />
<Compile Include="Floorplan\Model.fs" /> <Compile Include="Floorplan\Model.fs" />
<Compile Include="Floorplan\View.fs" />
<Compile Include="Floorplan\Controller.fs" /> <Compile Include="Floorplan\Controller.fs" />
<Compile Include="Floorplan\Router.fs" /> <Compile Include="Floorplan\Router.fs" />
<Compile Include="OrderScreen\Model.fs" /> <Compile Include="OrderScreen\Model.fs" />
@@ -106,168 +112,15 @@
<ExcludeFromSingleFile>true</ExcludeFromSingleFile> <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content> </Content>
<Content Include="views\restaurant\alert.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\authenticate.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\backupPayentsplitter.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\button.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\buttonWithImage.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\categories\BeerPage1.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\categories\BeerPage2.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\categories\DessertsPage1.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\categories\MainsPage1.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\categories\StartersPage1.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\categories\WinePage1.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\categoryButton.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\categoryMenu.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\components\posButton.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\decoratorItem.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\decoratorRow.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\floorplan.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\keyboards.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderBox.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderBoxTable.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen.tpl - Copy.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen\button_image.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen\change_cover_number_button.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen\cover_selector.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen\grid_button.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen\grid_container.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen\page.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen\page_group.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\orderScreen\page_group_button.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\paymentSplitter.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\popupBoxItems.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\roomButton.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\virtualKeyboard.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="views\restaurant\virtualNumpad.tpl.htm">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Folder Include="wwwroot\styles" /> <Folder Include="wwwroot\styles" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Dapper" Version="2.0.78" />
<PackageReference Include="Dapper.Contrib" Version="2.0.78" />
<PackageReference Include="Dapper.FSharp" Version="2.4.1" /> <PackageReference Include="Dapper.FSharp" Version="2.4.1" />
<PackageReference Include="FSharp.Data" Version="4.0.1" />
<PackageReference Include="Giraffe" Version="6.0.0-alpha-2" /> <PackageReference Include="Giraffe" Version="6.0.0-alpha-2" />
<PackageReference Include="Npgsql" Version="6.0.0" /> <PackageReference Include="Npgsql" Version="6.0.0" />
<PackageReference Include="Pluralize.NET.Core" Version="1.0.0" /> <PackageReference Include="Pluralize.NET.Core" Version="1.0.0" />
<PackageReference Include="Saturn" Version="0.15.0-preview03" /> <PackageReference Include="Saturn" Version="0.15.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.0" />
<PackageReference Include="FSharp.Data.SqlClient" Version="2.1.0-beta1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0-preview.2.21154.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0-preview.2.21154.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MySql.Data" Version="8.0.23" />
<PackageReference Include="MySql.Data.EntityFrameworkCore" Version="8.0.22" />
<PackageReference Include="SQLProvider" Version="1.2.1" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0-preview.5.21301.5" /> <PackageReference Include="System.Drawing.Common" Version="6.0.0-preview.5.21301.5" />
<PackageReference Include="Thoth.Json.Net" Version="5.0.0" /> <PackageReference Include="Thoth.Json.Net" Version="5.0.0" />
<PackageReference Update="FSharp.Core" Version="6.0.2-beta.21631.1" /> <PackageReference Update="FSharp.Core" Version="6.0.2-beta.21631.1" />

View File

@@ -1,27 +1,13 @@
module DredgePos.Entities.Floorplan_Decorations.Controller module DredgePos.Entities.Floorplan_Decorations.Controller
open DredgeFramework
open System
open System.IO open System.IO
let getImageHTML (imageName: string, imageUrl: string) =
let vars = map [
"image_name", imageName
"image_url", imageUrl
]
Theme.loadTemplateWithVars "decoratorItem" vars
let getImageRowHtml (imagesInRow: string[]) =
let vars = map ["decorations", String.Join("", imagesInRow)]
Theme.loadTemplateWithVars "decoratorRow" vars
let generateDecorator () = let generateDecorator () =
"wwwroot/images/decorations" "wwwroot/images/decorations"
|> Directory.GetFiles |> Directory.GetFiles
|> Array.filter Model.isImageFile |> Array.filter Model.isImageFile
|> Array.map Model.GetFileNameWithoutExtension |> Array.map Model.GetFileNameWithoutExtension
|> Array.map Model.getImageName |> Array.map Model.getImageName
|> Array.map getImageHTML |> Array.map View.decoratorItem
|> Array.chunkBySize 4 |> Array.chunkBySize 4
|> Array.map getImageRowHtml |> Array.map View.decoratorRow
|> JoinArray ""

View File

@@ -0,0 +1,24 @@
module DredgePos.Entities.Floorplan_Decorations.View
open Giraffe.ViewEngine
open DredgePos.Global.View
let decoratorItem (imageName, imageUrl) =
let image = attr "data-image"
div [_class "decoratorItem"; image imageUrl] [
a [_style $"background-image:url('/images/decorations/{imageUrl}')"] []
a [] [str imageName]
]
let decoratorRow decoratorItems = div [_class "decoratorRow"] [yield! decoratorItems]
let decorator (decorationRows: XmlNode[]) =
div [_id "decorator"] [
div [_id "decoratorHeader"] [
h2 [] [lang "choose_decoration"]
a [_class "posButton hideDecorator"] [str "×"]
]
div [_id "decoratorContent"] [
yield! decorationRows
]
]

View File

@@ -2,10 +2,13 @@
open DredgeFramework open DredgeFramework
open DredgePos open DredgePos
open DredgePos.Global.Controller
open DredgePos.Entities
open DredgePos.Types open DredgePos.Types
open Giraffe open Giraffe
open Microsoft.AspNetCore.Http open Microsoft.AspNetCore.Http
open Model open Model
open System.IO
let makeRoomButton (room: floorplan_room) = let makeRoomButton (room: floorplan_room) =
let vars = map [ let vars = map [
@@ -70,7 +73,7 @@ let deleteTable (table: floorplan_table) =
table |> ajaxSuccess |> json table |> ajaxSuccess |> json
let transferTable (origin, destination) = let transferTable (origin, destination) =
Model.transferTable origin destination transferTable origin destination
let data = map ["origin", getTable origin ; "destination", getTable destination] let data = map ["origin", getTable origin ; "destination", getTable destination]
ajaxSuccess data |> json ajaxSuccess data |> json
@@ -105,23 +108,12 @@ let DeleteDecoration (decorationToDelete: floorplan_decoration) =
|> ajaxSuccess |> ajaxSuccess
|> json |> json
let loadFloorplan (ctx: HttpContext) : HttpHandler = let loadFloorplanView (ctx: HttpContext) =
Authenticate.Model.RequireClerkAuthentication ctx Authenticate.Model.RequireClerkAuthentication ctx
let roomMenu = Entity.GetAllInVenue<floorplan_room> |> Array.map View.roomButton
let currentClerk = Authenticate.Model.getCurrentClerk ctx
let styles = [|"dredgepos.floorplan.css"|] |> addDefaultStyles
let scripts = [|"./external/konva.min.js" ; "dredgepos.floorplan.js"|] |> addDefaultScripts
let metaTags = [|"viewport", "user-scalable = no, initial-scale=0.8,maximum-scale=0.8 ,shrink-to-fit=yes"|] |> addDefaultMetaTags
let roomMenu = View.index styles scripts metaTags currentClerk (Floorplan_Decorations.Controller.generateDecorator ()) roomMenu
Entity.GetAllInVenue<floorplan_room>
|> Array.map makeRoomButton
|> joinWithNewLine
let variables = map [
"title", "Floorplan"
"roomMenu", roomMenu
"decorator", Entities.Floorplan_Decorations.Controller.generateDecorator()
]
let styles = ["dredgepos.floorplan.css"]
let scripts = ["./external/konva.min.js" ; "dredgepos.floorplan.js"]
let currentClerk = recordToMap <| Authenticate.Model.getCurrentClerk ctx
let arrays = map ["clerk", currentClerk]
htmlString <| Theme.loadTemplateWithVarsArraysScriptsAndStyles "floorplan" variables arrays scripts styles

View File

@@ -1,16 +1,17 @@
module DredgePos.Floorplan.Router module DredgePos.Floorplan.Router
open DredgePos open DredgePos
open DredgePos.Global.Router
open DredgePos.Types open DredgePos.Types
open Saturn open Saturn
open Giraffe open Giraffe
let floorplan = (warbler (fun ctx -> DredgePos.Floorplan.Controller.loadFloorplan (snd ctx))) let floorplan = (htmlViewWithContext Controller.loadFloorplanView)
let router = router { let router = router {
pipe_through Ajax.Router.pipeline pipe_through Ajax.Router.pipeline
get "/" floorplan
get "" floorplan get "" floorplan
get "/" floorplan
post "/mergeTables" (bindJson<floorplan_table[]> Controller.mergeTables) post "/mergeTables" (bindJson<floorplan_table[]> Controller.mergeTables)
post "/transformTable" (bindJson<floorplan_table> Controller.transformTable) post "/transformTable" (bindJson<floorplan_table> Controller.transformTable)
post "/createTable" (bindJson<floorplan_table> Controller.createTable) post "/createTable" (bindJson<floorplan_table> Controller.createTable)

88
Floorplan/View.fs Normal file
View File

@@ -0,0 +1,88 @@
module DredgePos.Floorplan.View
open DredgePos.Global
open DredgePos.Global.View
open DredgePos.Entities
open DredgePos.Types
open Giraffe.ViewEngine
open DredgeFramework
let VisibleInMode (value: string list) = value |> jsonEncode |> (attr "data-visible-in-mode")
let InvisibleInMode (value: string list) = value |> jsonEncode |> (attr "data-invisible-in-mode")
let ActiveInMode (value: string) = value |> (attr "data-active-in-mode")
let pageContainer (clerk: clerk) roomMenu =
let loggedInText = str (language.getAndReplace "logged_in_as" [clerk.clerk_name])
div [_id "pageContainer"] [
div [_id "floorplanLeftColumn"] [
div [_class "topCell"] [
a [_class "posHeader"] [loggedInText]
]
div [_class "middleCell"] []
div [_class "bottomCell"] []
]
div [_id "floorplanCenterColumn"] [
div [_class "topCell"] [
yield! roomMenu
]
div [_class "middleCell"] [
div [_id "floorplanCanvas"] []
div [_id "floorplanCanvas"] []
]
div [_class "bottomCell"] [
div [_class "editControls" ; VisibleInMode ["tableSelected"]] [
div [_class "posHeader currentTable"] [
b [_class "selectedTableNumber"] []
a [_class "reservationStatus"; VisibleInMode ["reservedTableSelected"]] []
small [_class "selectedTableCovers"] []
]
a [_class "posButton placeOrderButton"] [lang "order_table"]
a [_class "posButton reserveTableButton"; InvisibleInMode ["reservedTableSelected"; "activeTableSelected"]] [lang "reserve_table"]
a [_class "posButton unreserveTableButton"; VisibleInMode ["reservedTableSelected"]] [lang "unreserve_table"]
a [_class "posButton payTableButton"; VisibleInMode ["activeTableSelected"]] [lang "pay_table"]
a [_class "posButton viewTableButton"; VisibleInMode ["activeTableSelected"]] [lang "view_table"]
]
]
]
div [_id "floorplanRightColumn"] [
div [_class "topCell"] [
a [_class "posButton logOut"] [str "×"]
]
div [_class "middleCell"] [
a [_class "posButton editModeButton"] [lang "edit_floorplan"]
div [_class "floorplanControls useVisibility"; VisibleInMode ["edit"]] [
a [_class "posButton addTableButton"] [lang "add_table"]
a [_class "posButton addDecoration"] [lang "add_decoration"]
a [_class "posButton deleteDecoration useVisibility"; VisibleInMode ["decorationSelected"; "edit"] ] [lang "delete_decoration"]
a [_class "posButton deleteTableButton useVisibility"; VisibleInMode ["tableSelected"; "edit"]] [lang "delete_table"]
a [_class "posButton changeShapeButton useVisibility"; VisibleInMode ["tableSelected"; "edit"]] [lang "change_shape"]
]
div [_class "mergeControls useVisibility"; VisibleInMode ["tableSelected"]] [
a [_class "posButton mergeButton"; ActiveInMode "merge"] [lang "merge_table"]
a [_class "posButton unmergeButton"; VisibleInMode ["tableSelected"]] [lang "unmerge_table"]
a [_class "posButton transferTableButton" ; ActiveInMode "transfer" ; VisibleInMode ["activeTableSelected"]] [lang "transfer_table"]
]
]
div [_class "bottomCell"] []
]
]
let roomButton (room: floorplan_room) = a [_class "posButton roomButton"; Value (string room.id)] [str room.room_name ]
let index styles scripts tags clerk decoratorRows roomMenu =
[|
pageContainer clerk roomMenu
decoratorRows |> Floorplan_Decorations.View.decorator
|]
|> HtmlPage "Floorplan" (GetScripts scripts) (GetStyles styles) (GetMetaTags tags)

7
Global/Controller.fs Normal file
View File

@@ -0,0 +1,7 @@
module DredgePos.Global.Controller
open DredgeFramework
let addDefaultScripts scripts = scripts |> Array.append [|"./external/jquery.js" ; "dredgepos.core.js"; "keyboards.js";|]
let addDefaultStyles styles = styles |> Array.append [|"dark.theme.css";|]
let addDefaultMetaTags (tags: (string*string)[]) = tags |> Array.append [|"apple-mobile-web-app-capable", "yes"|]

11
Global/Router.fs Normal file
View File

@@ -0,0 +1,11 @@
module DredgePos.Global.Router
open Saturn
open Giraffe
let htmlViewWithContext func =
(fun ctx ->
func (snd ctx)
|> htmlView
)
|> warbler

109
Global/View.fs Normal file
View File

@@ -0,0 +1,109 @@
module DredgePos.Global.View
open Giraffe.ViewEngine
open DredgeFramework
let Value = attr "data-value"
let innerText = str
let lang key = language.get key |> str
let scriptToHTML (scriptFile: string) =
let scriptPath = $"/scripts/{scriptFile}"
match FileExists ("wwwroot" + scriptPath) with
| true -> script [_src scriptPath] []
| false -> comment $"[Missing script: {scriptFile}]"
let GetScripts (scripts: string[]) = scripts |> Array.map scriptToHTML
let styleToHTML (stylesheet:string) =
let stylePath = $"/styles/{stylesheet}"
match FileExists ("wwwroot" + stylePath) with
| true -> link [_rel "stylesheet" ; _href stylePath]
| false -> comment $"[Missing style: {stylesheet}]"
let GetStyles (scripts: string[]) = scripts |> Array.map styleToHTML
let tagToHtml (tag, content) = meta [_name tag; _content content]
let GetMetaTags (tags: (string * string)[]) = tags |> Array.map tagToHtml
let VirtualKeyboardRow numberOfButtons =
let buttons = Array.init numberOfButtons (fun _ -> a [] [])
div [_class "virtualKeyboardRow"] [
yield! buttons
]
let VirtualKeyboard =
div [_id "virtualKeyboard"] [
div [_class "headingRow"] [
h3 [_id "virtualKeyboardHeading"] []
a [_class "posButton closeKeyboards"] [str "X"]
]
input [_type "text"; _name "virtualKeyboardInput"; _id "virtualKeyboardInput"]
div [_id "virtualKeyboardButtons"] [
VirtualKeyboardRow 13
VirtualKeyboardRow 14
VirtualKeyboardRow 13
VirtualKeyboardRow 11
VirtualKeyboardRow 1
]
span [_class "forceFocus"] []
]
let VirtualNumpadButton (text: string) =
a [_href "#"; Value (text.ToLower()); _class "posButton virtualNumpadButton"] [str text]
let VirtualNumpadRow (buttons:string[]) =
div [_class "virtualNumpadRow"] [
yield! Array.map VirtualNumpadButton buttons
]
let VirtualNumpad =
div [_id "virtualNumpad"] [
div [_class "headingRow"] [
h3 [_id "virtualNumpadHeading"] []
a [_class "posButton closeKeyboards"] [str "X"]
]
div [_id "virtualNumpadInput"] []
div [_id "virtualNumpadButtons"] [
VirtualNumpadRow [|"1"; "2"; "3"|]
VirtualNumpadRow [|"4"; "5"; "6"|]
VirtualNumpadRow [|"7"; "8"; "9"|]
VirtualNumpadRow [|"0"; "."; "Clear"|]
VirtualNumpadRow [|"Submit"|]
]
]
let alert =
div [_id "alert"] [
div [_id "alertHeading"] []
div [_id "alertMessage"] []
div [_id "alertButtons"] [
a [_class "posButton"; _id "alertOk"] [lang "alert_ok"]
a [_class "posButton"; _id "alertYes"] [lang "alert_yes"]
a [_class "posButton"; _id "alertNo"] [lang "alert_no"]
]
]
let keyboards = [|
VirtualKeyboard
VirtualNumpad
alert
|]
let HtmlPage pageTitle scripts styles tags content =
html [] [
head [] [
title [] [innerText pageTitle]
link [_rel "manifest" ; _href "/manifest.webmanifest"]
yield! styles
yield! scripts
yield! tags
]
body [] [
yield! content
yield! keyboards
]
]
let HTMLPageWithScripts pageTitle scripts content = HtmlPage pageTitle scripts [||] content
let HTMLPageWithStyles pageTitle styles content = HtmlPage pageTitle [||] styles content
let HTMLPageWithNoScriptsOrStyles pageTitle content = HtmlPage pageTitle [||] [||] content

View File

@@ -173,7 +173,7 @@ const createTableShape = (table: floorplan_table) => {
stroke: "black", stroke: "black",
strokeWidth: 4, strokeWidth: 4,
draggable: false, draggable: false,
listening: true listening: true,
}); });
break; break;
default: default:

View File

@@ -228,7 +228,6 @@ let showVirtualNumpad = (heading: string, maxlength = 4, isPassword: boolean, al
index = index + 1 index = index + 1
let currentRow : string[] = layoutToLoad[`row${index}${modifier}`] let currentRow : string[] = layoutToLoad[`row${index}${modifier}`]
$(row).children('a').each((keyIndex, button) => { $(row).children('a').each((keyIndex, button) => {
let key = $(button); let key = $(button);
let keyValue: string = currentRow[keyIndex]; let keyValue: string = currentRow[keyIndex];

View File

@@ -1,9 +0,0 @@
<div id="alert" >
<div id="alertHeading"></div>
<div id="alertMessage"></div>
<div id="alertButtons">
<a class="posButton" id="alertOk"><!--[lang:alert_ok]--></a>
<a class="posButton" id="alertYes"><!--[lang:alert_yes]--></a>
<a class="posButton" id="alertNo"><!--[lang:alert_no]--></a>
</div>
</div>

View File

@@ -1,15 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title><!--[var:title]--></title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name = "viewport" content = "user-scalable = no, initial-scale=0.8,maximum-scale=0.8 ,shrink-to-fit=yes" />
<link rel="manifest" href="/manifest.webmanifest">
</head>
<body>
<div id="authenticator">
</div>
<!--[template:keyboards]-->
</body>
</html>

View File

@@ -1,113 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>DredgePOS</title>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="stylesheet" type="text/css" href="themes/restaurant/theme.css?id=ax" media="screen" />
<link rel="stylesheet" type="text/css" href="themes/restaurant/paymentSplitter.css?id=ax" media="screen" />
<meta name = "viewport" content = "width=1280, initial-scale = 0.8, user-scalable = no, shrink-to-fit=no" />
<script type="text/javascript" src="currency.min.js"></script>
<script type="text/javascript" src="posFunctions.js"></script>
<script type="text/javascript" src="paymentFunctions.js"></script>
</head>
<body class="darkMode">
<div id="pageContainer">
<div id="flexWrapper">
<div id="header">
<h1>Paying Table</h2>
</div>
<div id="stucture">
<div id="leftColumn">
<h2>Whole Table</h2>
<table id="first" cellspacing="0">
<thead>
<th class="hide">Item Code</th>
<th>Qty</th>
<th>Item</th>
<th class="hide">Unit Price</th>
<th class="hide">Print Group</th>
<th class="totalpriceCell">Total Price</th>
<th class="hide">Cover</th>
<th class="clerkCell">Clerk</th>
<th class="hide">Selected Qty</th>
<th class="hide">Original Qty</th>
<th class="hide">Category</th>
<th class="hide">Department</th>
<th class="hide"><!--[lang:has_split_header]--></th>
<th class="hide"><!--[lang:orig_tprice_header]--></th>
</thead>
<tbody>
<!--[var:tableHTML]-->
</tbody>
</table>
</div>
<div id="controlColumn">
<a class="posButton" onclick="moveItems('#first', '#second')">&gt;</a>
<a class="posButton" onclick="moveItems('#second', '#first')">&lt;</a>
</div>
<div id="centerColumn">
<h2>Partial Table</h2>
<table id="second" cellspacing="0">
<thead>
<th class="hide">Item Code</th>
<th>Qty</th>
<th>Item</th>
<th class="hide">Unit Price</th>
<th class="hide">Print Group</th>
<th class="totalpriceCell">Total Price</th>
<th class="hide">Cover</th>
<th class="clerkCell hide">Clerk</th>
<th class="hide">Selected Qty</th>
<th class="hide">Category</th>
<th class="hide">Department</th>
<th class="hide"><!--[lang:has_split_header]--></th>
<th class="hide"><!--[lang:orig_tprice_header]--></th>
</thead>
<tbody>
</tbody>
</table>
</div>
<div id="rightColumn">
<h2>Controls</h2>
<div id="rightColumnContainer">
<a class="posButton heading" onclick="">Selection Tools</a>
<a class="posButton qtySelector" onclick="overrideQuantitySelect()">Select Quantity</a>
<a class="posButton" onclick="overrideQuantitySelect()">Select Amount</a>
<a class="selectDepartment posButton">Select By Department</a>
<a class="selectCategory posButton">Select By Category</a>
<a class="selectCovers posButton">Select by Cover #</a>
<a class="selectPrintGroup posButton">Select by Printed With</a>
<a class="selectAll posButton">Select All</a>
<a class="posButton heading">Select By Fraction</a>
<a class="posButton selectFraction" data-value="2">Select 12</a>
<a class="posButton selectFraction" data-value="3">Select 13</a>
<a class="posButton selectFraction" data-value="4">Select 14</a>
<a class="posButton selectFraction" data-value="5">Select 15</a>
<a class="posButton selectFraction" data-value="6">Select 16</a>
<a class="posButton selectFraction" data-value="7">Select 17</a>
<a class="posButton selectFraction" data-value="8">Select 18</a>
<a class="posButton selectFraction" data-value="<!--[var:uniqueCovers]-->" posButton">Select 1covers</a>
<a class="posButton heading" onclick="loadScreen('tableMap')">Exit</a>
</div>
</div>
</div>
</div>
</div>
<div id="coverControls" class="popupBox"><!--[var:coverButtons]--></div>
<div id="departmentControl" class="popupBox"><!--[var:departmentButtons]--></div>
<div id="categoryControl" class="popupBox"><!--[var:categoryButtons]--></div>
<div id="printGroupControl" class="popupBox"><!--[var:printGroupButtons]--></div>
<!--[template:keyboards]-->
<script type="text/javascript">
$(document).ready( function () {
covers = '<!--[var:covers]-->'
dredgePosSetup('#pageContainer');
setupPaymentSplitter();
} );
</script>
</body>
</html>

View File

@@ -1,14 +0,0 @@
<div class="itemCellWrapper">
<div
class="definedButton item <!--[arr:item|button_classes]--> posButton"
data-type="<!--[arr:item|type]-->"
data-id="<!--[arr:item|itemid]-->"
data-grid="<!--[arr:item|button_grid_id]-->"
data-name="<!--[arr:item|itemname]-->"
data-price="<!--[arr:item|price]-->"
data-category="<!--[arr:item|c_name]-->"
data-department="<!--[arr:item|dep_name]-->"
data-printgroup="<!--[arr:item|pg_name]-->">
<a><!--[arr:item|itemname]--></a>
</div>
</div>

View File

@@ -1,14 +0,0 @@
<div class="itemCellWrapper"> <div
class="definedButton item hasImage <!--[arr:item|button_classes]--> posButton"
data-type="<!--[arr:item|type]-->"
data-id="<!--[arr:item|itemid]-->"
data-name="<!--[arr:item|itemname]-->"
data-price="<!--[arr:item|price]-->"
data-grid="<!--[arr:item|button_grid_id]-->"
data-category="<!--[arr:item|c_name]-->"
data-department="<!--[arr:item|dep_name]-->"
data-printgroup="<!--[arr:item|pg_name]-->">
<a style="background-image:url('images/<!--[arr:item|image]-->')"></a>
<a><!--[arr:item|itemname]--></a>
</div></div>

View File

@@ -1,67 +0,0 @@
<div class="itemPage">
<table cellspacing="0" cellpadding="0">
<tr>
<td><!--[button:CRAFTBEER001]--></td>
<td><!--[button:CRAFTBEER002]--></td>
<td><!--[button:CRAFTBEER003]--></td>
<td><!--[button:CRAFTBEER004]--></td>
<td><!--[button:CRAFTBEER005]--></td>
<td><!--[button:CRAFTBEER006]--></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><!--[button:CRAFTBEER007]--></td>
<td><!--[button:CRAFTBEER008]--></td>
<td><!--[button:CRAFTBEER009]--></td>
<td><!--[button:CRAFTBEER010]--></td>
<td><!--[button:CRAFTBEER012]--></td>
<td><!--[button:INSTRUCTION005]--></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><!--[button:INSTRUCTION006]--></td>
</tr>
<tr>
<td><!--[button:CRAFTBEER013]--></td>
<td><!--[button:CRAFTBEER014]--></td>
<td><!--[button:CRAFTBEER015]--></td>
<td><!--[button:CRAFTBEER016]--></td>
<td><!--[button:CRAFTBEER017]--></td>
<td><!--[button:CRAFTBEER018]--></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><!--[button:CRAFTBEER019]--></td>
<td><!--[button:CRAFTBEER020]--></td>
<td><!--[button:CRAFTBEER021]--></td>
<td><!--[button:CRAFTBEER022]--></td>
<td><!--[button:CRAFTBEER023]--></td>
<td><!--[button:CRAFTBEER024]--></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table></div>

View File

@@ -1,67 +0,0 @@
<div class="itemPage">
<table cellspacing="0" cellpadding="0">
<tr>
<td><!--[button:CRAFTBEER025]--></td>
<td><!--[button:CRAFTBEER026]--></td>
<td><!--[button:CRAFTBEER027]--></td>
<td><!--[button:CRAFTBEER028]--></td>
<td><!--[button:CRAFTBEER029]--></td>
<td><!--[button:CRAFTBEER030]--></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><!--[button:CRAFTBEER031]--></td>
<td><!--[button:CRAFTBEER032]--></td>
<td><!--[button:CRAFTBEER033]--></td>
<td><!--[button:CRAFTBEER034]--></td>
<td><!--[button:CRAFTBEER035]--></td>
<td><!--[button:CRAFTBEER036]--></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><!--[button:CRAFTBEER037]--></td>
<td><!--[button:CRAFTBEER038]--></td>
<td><!--[button:CRAFTBEER039]--></td>
<td><!--[button:CRAFTBEER040]--></td>
<td><!--[button:CRAFTBEER041]--></td>
<td><!--[button:CRAFTBEER042]--></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><!--[button:CRAFTBEER043]--></td>
<td><!--[button:CRAFTBEER044]--></td>
<td><!--[button:CRAFTBEER045]--></td>
<td><!--[button:CRAFTBEER046]--></td>
<td><!--[button:CRAFTBEER047]--></td>
<td><!--[button:CRAFTBEER048]--></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table></div>

View File

@@ -1,66 +0,0 @@
<div class="itemPage"><table cellspacing="0" cellpadding="0">
<tr>
<td><!--[button:DESSERT001]--></td>
<td></td>
<td><!--[button:DESSERT002]--></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td><!--[button:DESSERT004]--></td>
<td></td>
<td><!--[button:DESSERT003]--></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table></div>

View File

@@ -1,67 +0,0 @@
<div class="itemPage"><table cellspacing="0" cellpadding="0">
<tr>
<td><!--[button:MAIN001]--></td>
<td></td>
<td><!--[button:MAIN003]--></td>
<td></td>
<td><!--[button:MAIN004]--></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><!--[button:MAIN005]--></td>
<td></td>
<td><!--[button:MAIN006]--></td>
<td></td>
<td><!--[button:MAIN007]--></td>
<td></td>
</td>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table></div>

View File

@@ -1,68 +0,0 @@
<div class="itemPage">
<table cellspacing="0" cellpadding="0">
<tr>
<td><!--[button:STARTER001]--></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><!--[button:STARTER002]--></td>
<td></td>
<td><!--[button:DIP002]--></td>
<td><!--[button:DIP003]--></td>
<td><!--[button:DIP004]--></td>
<td><!--[button:DIP005]--></td>
</tr>
<tr>
<td><!--[button:STARTER003]--></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><!--[button:STARTER004]--></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><!--[button:STARTER005]--></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table></div>

View File

@@ -1,67 +0,0 @@
<div class="itemPage"><table cellspacing="0" cellpadding="0">
<tr>
<td></td>
<td></td>
<td><!--[button:WINE002]--></td>
<td><!--[button:WINE001]--></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td><!--[button:WINE004]--></td>
<td><!--[button:WINE003]--></td>
<td></td>
<td></td>
</td>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table></div>

View File

@@ -1,3 +0,0 @@
<a onclick="loadCategory('<!--[arr:cat|c_name]-->')" class="posButton categoryButton">
<!--[arr:cat|c_name]-->
</a>

View File

@@ -1,5 +0,0 @@
<!--[categoryButton:1]-->
<!--[categoryButton:2]-->
<!--[categoryButton:4]-->
<!--[categoryButton:3]-->
<!--[categoryButton:5]-->

View File

@@ -1,3 +0,0 @@
<a class="posButton <!--[var:classes]-->" <!--[var: attributes]-->>
<!--[var:text]-->
</a>

View File

@@ -1,4 +0,0 @@
<div class="decoratorItem" data-image="<!--[var:image_url]-->">
<a style="background-image:url('/images/decorations/<!--[var:image_url]-->')"></a>
<a><!--[var:image_name]--></a>
</div>

View File

@@ -1,3 +0,0 @@
<div class="decoratorRow">
<!--[var:decorations]-->
</div>

View File

@@ -1,79 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>DredgePOS</title>
<script src="https://unpkg.com/current-device/umd/current-device.min.js"></script>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name = "viewport" content = "user-scalable = no, initial-scale=0.8,maximum-scale=0.8 ,shrink-to-fit=yes" />
<link rel="manifest" href="/manifest.webmanifest">
</head>
<body class="darkMode">
<div id="pageContainer">
<div id="floorplanLeftColumn">
<div class="topCell">
<a class="posHeader">Logged in as <!--[arr:clerk|clerk_name]--></a>
</div>
<div class="middleCell">
</div>
<div class="bottomCell">
</div>
</div>
<div id="floorplanCenterColumn">
<div class="topCell">
<!--[var:roomMenu]-->
</div>
<div class="middleCell">
<div id="floorplanCanvas"></div>
</div>
<div class="bottomCell">
<div class="editControls" data-visible-in-mode='["tableSelected"]'>
<div class="posHeader currentTable">
<b class="selectedTableNumber"></b>
<a class="reservationStatus" data-visible-in-mode='["reservedTableSelected"]'></a>
<small class="selectedTableCovers"></small>
</div>
<a class="posButton placeOrderButton"><!--[lang:order_table]--></a>
<a class="posButton reserveTableButton" data-invisible-in-mode='["reservedTableSelected", "activeTableSelected"]'><!--[lang:reserve_table]--></a>
<a class="posButton unreserveTableButton" data-visible-in-mode='["reservedTableSelected"]'><!--[lang:unreserve_table]--></a>
<a class="posButton payTableButton" data-visible-in-mode='["activeTableSelected"]'><!--[lang:pay_table]--></a>
<a class="posButton viewTableButton" data-visible-in-mode='["activeTableSelected"]'><!--[lang:view_table]--></a>
</div>
</div>
</div>
<div id="floorplanRightColumn">
<div class="topCell">
<a class="posButton logOut" onclick="logout()">×</a>
</div>
<div class="middleCell">
<a class="posButton editModeButton"><!--[lang:edit_floorplan]--></a>
<div class="floorplanControls useVisibility" data-visible-in-mode='["edit"]'>
<a class="posButton addTableButton" ><!--[lang:add_table]--></a>
<a class="posButton addDecoration"><!--[lang:add_decoration]--></a>
<a class="posButton deleteDecoration useVisibility" data-visible-in-mode='["decorationSelected", "edit"]'><!--[lang:delete_decoration]--></a>
<a class="posButton deleteTableButton useVisibility" data-visible-in-mode='["tableSelected", "edit"]'><!--[lang:delete_table]--></a>
<a class="posButton changeShapeButton useVisibility" data-visible-in-mode='["tableSelected", "edit"]'><!--[lang:change_shape]--></a>
</div>
<div class="mergeControls useVisibility" data-visible-in-mode='["tableSelected"]'>
<a class="posButton mergeButton" data-active-in-mode="merge"><!--[lang:merge_table]--></a>
<a class="posButton unmergeButton" data-visible-in-mode='["tableSelected"]'><!--[lang:unmerge_table]--></a>
<a class="transferTableButton posButton" data-active-in-mode="transfer" data-visible-in-mode='["activeTableSelected"]'><!--[lang:transfer_table]--></a>
</div>
</div>
<div class="bottomCell">
</div>
</div>
</div>
<!--[template:keyboards]-->
<div id="decorator">
<div id="decoratorHeader">
<h2><!--[lang:choose_decoration]--></h2>
<a class="posButton" onclick="$('#decorator').css('display','none')">×</a>
</div>
<div id="decoratorContent"><!--[var:decorator]--></div>
</div>
</body>
</html>

View File

@@ -1,3 +0,0 @@
<!--[template:alert]-->
<!--[template:virtualNumpad]-->
<!--[template:virtualKeyboard]-->

View File

@@ -1 +0,0 @@
<b>OrderBox Loaded</b>

View File

@@ -1,21 +0,0 @@
<table cellspacing="0" id="orderBox" data-tablenumber="<!--[var:tableNumber]-->" data-covers="<!--[var:covers]-->" data-clerk="<!--[arr:clerk|clerk_name]-->" class="">
<thead>
<tr>
<th class="idCell hide"><!--[lang:id_header]--></th>
<th class="qtyCell"><!--[lang:qty_header]--></th>
<th class="itemCell"><!--[lang:item_header]--></th>
<th class="totalPriceCell"><!--[lang:total_price_header]--></th>
<th class="printGroupCell"><!--[lang:printgroup_header]--></th>
<th class="unitPriceCell hide"><!--[lang:individual_price_header]--></th>
<th class="sortkeyCell hide"><!--[lang:sortkey_header]--></th>
<th class="typeCell hide"><!--[lang:type_header]--></th>
<th class="coverCell hide"><!--[lang:cover_header]--></th>
<th class="departmentCell hide"><!--[lang:department_header]--></th>
<th class="categoryCell hide"><!--[lang:category_header]--></th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
</tfoot>
</table>

View File

@@ -1,107 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>DredgePOS</title>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="stylesheet" type="text/css" href="themes/restaurant/theme.css?id=ax" media="screen" />
<link rel="stylesheet" type="text/css" href="themes/restaurant/screen.css?id=ax" media="screen" />
<meta name = "viewport" content = "width=1280, initial-scale = 0.8, user-scalable = no, shrink-to-fit=no" />
<script type="text/javascript" src="posFunctions.js"></script>
</head>
<body class="darkMode">
<div id="pageContainer">
<div id="leftColumn">
<div id="tableDetails">
<h2><span id="activeTable"><!--[var:activeTable]--></span></h2>
<p class="posButton coverNumbers"><span id="covers"><!--[var:covers]--></span> covers </p>
<p class="clerk"><!--[var:loggedInAs]--></p>
</div>
<div id="orderBoxContainer">
<!--[template:orderBoxTable]-->
</div>
<div id="leftColumnFooter">
<p class="messageBox"></p>
<h2>Total Price: &nbsp; &nbsp;<span class="orderBoxTotals">$0.00</span></h2>
<p class="selectedTotal">($0.00 Selected)</p>
</div>
</div>
<div id="rightColumn">
<div id="topHalf">
<div id="courseSelect" class="posButtonGroup">
<h2><!--[lang:print_with]--></h2>
<a onclick="setPrintGroupOverride(false, this)" class="toggle default posButton active"><!--[lang:print_with_category|default]--></a>
<a onclick="setPrintGroupOverride('Starters',this)" class="posButton toggle"><!--[lang:print_with_category|Starters]--></a>
<a onclick="setPrintGroupOverride('Mains',this)" class="posButton toggle"><!--[lang:print_with_category|Mains]--></a>
<a onclick="setPrintGroupOverride('Desserts',this)" class="posButton toggle"><!--[lang:print_with_category|Desserts]--></a>
<a onclick="setPrintGroupOverride('Drinks',this)" class="posButton toggle"><!--[lang:print_with_category|Drinks]--></a>
</div>
<div id="functions">
<h2><!--[lang:functions_header]--></h2>
<a onclick="loadScreen('tableMap')" class="posButton"><!--[lang:close_order_function]--></a>
<a class="posButton accumulateButton"><!--[lang:accumulate_function]--></a>
<a class="posButton void"><!--[lang:void]--></a>
<a class="posButton"><!--[lang:pay_function]--></a>
<a class="posButton saveOrder"><!--[lang:print_function]--></a>
</div>
<div id="positionControl">
<a class="posButton freeText" data-type="instruction" data-id="freetext"
data-name=""
data-price="0"
data-category="0"
data-department="0"
data-printgroup="0"><!--[lang:freetext_button]--></a>
<div type="text" class="positionInput"><!--[lang:select_covers]--></div>
<div id="positions">
</div>
</form>
</div>
<div id="topNumPad" class="numPad">
<a class="posButton numberButton">1</a>
<a class="posButton numberButton">2</a>
<a class="posButton numberButton">3</a>
<a class="posButton numberButton">4</a>
<a class="posButton numberButton">5</a>
<a class="posButton numberButton">6</a>
<a class="posButton numberButton">7</a>
<a class="posButton numberButton">8</a>
<a class="posButton numberButton">9</a>
<a class="posButton numberButton">0</a>
<a class="posButton numberButton">.</a>
<a class="posButton multiplier">×</a>
</div>
</div>
<div id="bottomHalf">
<!--[template:categoryMenu]-->
<div id="itemGrid">
<div id="itemWrapper">
<!--[template:categories/StartersPage1]-->
</div>
</div>
<div id="innerNavigation">
<a class="posButton" onclick="scrollPage('left')">&lt;</a>
<a class="posButton" onclick="scrollPage('right')">&gt;</a>
</div>
</div>
</div>
</div>
<!--[template:keyboards]-->
<script type="text/javascript">
$(document).ready( function () {
//Base grid width must be defined for multipage functionality to work.
baseGridWidth = 850;
dredgePosSetup();
$("#orderBox tbody tr").on( 'click', function ( e ) {
selectRow($(this));
} )
} );
</script>
</body>
</html>

View File

@@ -1,84 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>DredgePOS</title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name = "viewport" content = "user-scalable = no ,shrink-to-fit=yes" />
<link rel="manifest" href="/manifest.webmanifest">
</head>
<body>
<div id="pageContainer" <!--[var: containerAttributes]-->>
<div id="leftColumn">
<h1 class="tableHeading"><!--[var: orderNumber]--></h1>
<div class="tableInfo">
<!--[var: changeCoverNumberButton]-->
<a class="posButton">Logged in as <!--[arr:clerk|clerk_name]--></a>
</div>
<div class="orderBox">
<table class="orderBoxTable">
<thead>
<tr>
<th class="orderBoxCell qtyCell"><!--[lang:qty_header]--></th>
<th class="orderBoxCell itemIdCell hidden"><!--[lang:id_header]--></th>
<th class="orderBoxCell itemCell"><!--[lang:item_header]--></th>
<th class="orderBoxCell unitPriceCell hidden"><!--[lang:price_header]--></th>
<th class="orderBoxCell totalPriceCell"><!--[lang:total_price_header]--></th>
<th class="orderBoxCell printGroupCell"><!--[lang:printgroup_header]--></th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="orderBoxInfo">
<span class="voidModeWarning" data-visible-in-mode='["void"]'><!--[lang:void_mode]--></span>
</div>
<div class="orderBoxFooter">
<span class="orderBoxTotal"><!--[lang:totalPrice|0.00]--></span>
<small class="orderBoxSelectedTotal"><!--[lang:selectedPrice|0.00]--></small>
</div>
</div>
<div id="rightColumn">
<div id="topHalf">
<div class="functionButtons">
<div class="printGroupButtons toggleGroup">
<input type="hidden" name="print_override" class="value" />
<!--[var:salesCategoryOverrideButtons]-->
</div>
<div class="functionColumn">
<a class="posButton accumulateButton" data-active-in-mode="accumulate"><!--[lang:accumulate_function]--></a>
<a class="showCoverSelectorButton posButton"><!--[lang:select_covers]--></a>
</div>
<div class="functionColumn">
<a class="posButton voidButton" data-active-in-mode="void"><!--[lang:void]--></a>
<a class="posButton openItemButton"><!--[lang:custom_item_button]--></a>
<a class="freetextButton posButton"><!--[lang:freetext_button]--></a>
<a class="numpadButton posButton"><!--[lang:numpad_button]--></a>
</div>
<div class="functionColumn">
<a class="posButton"><!--[lang:pay_function]--></a>
<a class="posButton"><!--[lang:print_function]--></a>
</div>
</div>
</div>
<div id="pageList">
<!--[var:categoryList]-->
</div>
<div id="pageGroupContainer">
<!--[var:pageGroups]-->
</div>
<div class="pageNavigation">
<a class="posButton prevButton"><!--[lang:prev_page]--></a>
<a class="posButton nextButton"><!--[lang:next_page]--></a>
</div>
</div>
</div>
<!--[template:keyboards]-->
<!--[template:orderScreen/grid_container]-->
<!--[template:orderScreen/cover_selector]-->
<template id="posButtonTemplate">
<!--[template:components/posButton]-->
</template>
</body>
</html>

View File

@@ -1 +0,0 @@
<span class="buttonImg" style="background-image:url(/images/items/<!--[var:image]-->);"></span>

View File

@@ -1 +0,0 @@
<a href="#" class="posButton changeCoverNumberButton"><!--[var:covers]--></a>

View File

@@ -1,3 +0,0 @@
<div class="coverSelector">
<!--[var:coverSelectorButtons]-->
</div>

View File

@@ -1,6 +0,0 @@
<a href="#" class="posButton <!--[var:extra_classes]-->"
data-primary-action="<!--[var:primary_action]-->"
data-secondary-action="<!--[var:secondary_action]-->" <!--[var: extra_data]--> <!--[var: extra_styles]-->>
<!--[var:image]-->
<span class="text"><!--[var:text]--></span>
</a>

View File

@@ -1,13 +0,0 @@
<div class="gridContainer">
<div class="gridContainerHeader">
<span></span>
<div class="posButton closeGrid">×</div>
</div>
<div class="gridContainerGrid">
<div class="pageGroup"></div>
</div>
<div class="pageNavigation">
<a class="posButton prevButton"><!--[lang:prev_page]--></a>
<a class="posButton nextButton"><!--[lang:next_page]--></a>
</div>
</div>

View File

@@ -1,6 +0,0 @@
<div class="gridPage" style="
grid-template-columns: repeat(<!--[var:cols]-->, 1fr);
grid-template-rows: repeat(<!--[var:rows]-->, 1fr);
">
<!--[var:pageButtons]-->
</div>

View File

@@ -1,3 +0,0 @@
<div class="pageGroup" data-page-group-id="<!--[var:page_group_id]-->">
<!--[var:pages]-->
</div>

View File

@@ -1,3 +0,0 @@
<a data-page-group-id="<!--[arr:page|id]-->" class="posButton loadPageGroup">
<!--[arr:page|label]-->
</a>

View File

@@ -1,157 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>DredgePOS</title>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="https://unpkg.com/current-device/umd/current-device.min.js"></script>
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="stylesheet" type="text/css" href="themes/restaurant/theme.css?id=ax" media="screen" />
<link rel="stylesheet" type="text/css" href="themes/restaurant/paymentSplitter.css?id=ax" media="screen" />
<meta name = "viewport" content = "user-scalable = no, initial-scale=0.8 ,shrink-to-fit=yes" />
<script type="text/javascript" src="currency.min.js"></script>
<script type="text/javascript" src="posFunctions.js"></script>
<script type="text/javascript" src="paymentFunctions.js"></script>
</head>
<body class="darkMode" data-tablenumber="<!--[var:activeTable]-->">
<div id="pageContainer">
<div id="flexWrapper">
<div id="header">
<a class="posButton"><!--[var:loggedInAs]--></a>
<h1><!--[lang:paying_table|<!--[var:activeTable]-->]--></h1>
<a class="posButton exit" onclick="loadScreen('tableMap')">×</a>
</div>
<div id="pageStructure">
<div id="leftColumn">
<h2>Whole Table</h2>
<div class="tableWrapper">
<table id="first" cellspacing="0">
<thead>
<th class="hide"><!--[lang:id_header]--></th>
<th><!--[lang:qty_header]--></th>
<th><!--[lang:item_header]--></th>
<th class="hide"><!--[lang:individual_price_header]--></th>
<th class="hide"><!--[lang:printgroup_header]--></th>
<th class="totalpriceCell"><!--[lang:total_price_header]--></th>
<th class="hide"><!--[lang:cover_header]--></th>
<th class="clerkCell"><!--[lang:clerk_header]--></th>
<th class="hide"><!--[lang:orig_qty_header]--></th>
<th class="hide"><!--[lang:category_header]--></th>
<th class="hide"><!--[lang:department_header]--></th>
<th class="hide"><!--[lang:orig_tprice_header]--></th>
</thead>
<tbody>
<!--[var:tableHTML]-->
</tbody>
</table>
</div>
<div class="tableFooter">
<div class="totalsRow">
<h3 class="firstTotal"></h3>
<p class="firstSelectedTotal"></p>
</div>
<div class="controlRow">
<a class="posButton payAll"><!--[lang:pay_all]--></a>
</div>
</div>
</div>
<div id="controlColumn">
<a class="posButton" onclick="moveItems('#first', '#second')">&gt;</a>
<a class="posButton" onclick="moveItems('#second', '#first')">&lt;</a>
</div>
<div id="centerColumn">
<h2>Partial Table</h2>
<div class="tableWrapper">
<table id="second" cellspacing="0">
<thead>
<th class="hide"><!--[lang:id_header]--></th>
<th><!--[lang:qty_header]--></th>
<th><!--[lang:item_header]--></th>
<th class="hide"><!--[lang:individual_price_header]--></th>
<th class="hide"><!--[lang:printgroup_header]--></th>
<th class="totalpriceCell"><!--[lang:total_price_header]--></th>
<th class="hide"><!--[lang:cover_header]--></th>
<th class="clerkCell"><!--[lang:clerk_header]--></th>
<th class="hide"><!--[lang:orig_qty_header]--></th>
<th class="hide"><!--[lang:category_header]--></th>
<th class="hide"><!--[lang:department_header]--></th>
<th class="hide"><!--[lang:orig_tprice_header]--></th>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="tableFooter">
<div class="totalsRow">
<h3 class="secondTotal"></h3>
<p class="secondSelectedTotal"></p>
</div>
<div class="controlRow">
<a class="posButton payPartial"><!--[lang:pay_table]--></a>
<a class="posButton transferPartial">Transfer to Another Table</a>
<a class="posButton selectAllSecond">Select All</a>
</div>
</div>
</div>
<div id="rightColumn">
<h2>Controls</h2>
<div id="rightColumnContainer">
<div class="row">
<a class="heading" onclick="">Selection Tools</a>
</div>
<div class="row">
<a class="posButton qtySelector">Select Quantity</a>
<a class="posButton selectAmount">Select Amount</a>
</div>
<div class="row">
<a class="selectDepartment posButton">Select By Department</a>
<a class="selectCategory posButton">Select By Category</a>
</div>
<div class="row">
<a class="selectCovers posButton">Select by Cover #</a>
<a class="selectPrintGroup posButton">Select by Printed With</a>
</div>
<div class="row">
<a class="selectAll posButton">Select All</a>
</div>
<div class="row">
<a class="heading">Select By Fraction</a>
</div>
<div class="row">
<a class="posButton selectFraction" data-value="2">Select 12</a>
<a class="posButton selectFraction" data-value="3">Select 13</a>
</div>
<div class="row">
<a class="posButton selectFraction" data-value="4">Select 14</a>
<a class="posButton selectFraction" data-value="5">Select 15</a>
</div>
<div class="row">
<a class="posButton selectFraction" data-value="6">Select 16</a>
<a class="posButton selectFraction" data-value="7">Select 17</a>
</div>
<div class="row">
<a class="posButton selectFraction" data-value="8">Select 18</a>
<a class="posButton selectFraction" data-value="<!--[var:covers]-->">Select 1covers</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="coverControls" class="popupBox"><!--[var:coverButtons]--></div>
<div id="departmentControl" class="popupBox"><!--[var:departmentButtons]--></div>
<div id="categoryControl" class="popupBox"><!--[var:categoryButtons]--></div>
<div id="printGroupControl" class="popupBox"><!--[var:printGroupButtons]--></div>
<!--[template:keyboards]-->
<script type="text/javascript">
$(document).ready( function () {
covers = '<!--[var:covers]-->'
dredgePosSetup('#pageContainer');
setupPaymentSplitter();
} );
</script>
</body>
</html>

View File

@@ -1 +0,0 @@
<a data-value="<!--[var:value]-->" class="posButton <!--[var:class]-->"><!--[var:text]--></a>

View File

@@ -1 +0,0 @@
<a class="posButton roomButton" data-value="<!--[var:roomId]-->"><!--[var:roomName]--></a>

View File

@@ -1,71 +0,0 @@
<div id="virtualKeyboard">
<div class="headingRow">
<h3 id="virtualKeyboardHeading"></h3>
<a class="posButton closeKeyboards">X</a>
</div>
<input type="text" name="virtualKeyboardInput" id="virtualKeyboardInput" />
<div id="virtualKeyboardButtons">
<div class="virtualKeyboardRow">
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
</div>
<div class="virtualKeyboardRow">
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
</div>
<div class="virtualKeyboardRow">
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
</div>
<div class="virtualKeyboardRow">
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
</div>
<div class="virtualKeyboardRow">
<a></a>
</div>
<span class="forceFocus"></span>
</div>
</div>

View File

@@ -1,28 +0,0 @@
<div id="virtualNumpad">
<div class="headingRow">
<h3 id="virtualNumpadHeading"></h3>
<a class="posButton closeKeyboards">X</a>
</div>
<div id="virtualNumpadInput"></div>
<div id="virtualNumpadButtons">
<div class="virtualNumpadRow">
<a href="#" data-value="1" class="posButton virtualNumpadButton">1</a>
<a href="#" data-value="2" class="posButton virtualNumpadButton">2</a>
<a href="#" data-value="3" class="posButton virtualNumpadButton">3</a>
</div><div class="virtualNumpadRow">
<a href="#" data-value="4" class="posButton virtualNumpadButton">4</a>
<a href="#" data-value="5" class="posButton virtualNumpadButton">5</a>
<a href="#" data-value="6" class="posButton virtualNumpadButton">6</a>
</div><div class="virtualNumpadRow">
<a href="#" data-value="7" class="posButton virtualNumpadButton">7</a>
<a href="#" data-value="8" class="posButton virtualNumpadButton">8</a>
<a href="#" data-value="9" class="posButton virtualNumpadButton">9</a>
</div><div class="virtualNumpadRow">
<a href="#" data-value="0" class="posButton virtualNumpadButton">0</a>
<a href="#" data-value="." class="posButton virtualNumpadButton">.</a>
<a href="#" data-value="clear" class="posButton virtualNumpadButton virtualNumpadClear">Clear</a>
</div><div class="virtualNumpadRow">
<a href="#" data-value="submit" class="posButton virtualNumpadButton virtualNumpadSubmit">Enter</a>
</div>
</div>
</div>