view progression
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
<Compile Include="Floorplan\Controller.fs" />
|
||||
<Compile Include="Floorplan\Router.fs" />
|
||||
<Compile Include="OrderScreen\Model.fs" />
|
||||
<Compile Include="OrderScreen\View.fs" />
|
||||
<Compile Include="OrderScreen\Controller.fs" />
|
||||
<Compile Include="OrderScreen\Router.fs" />
|
||||
<Compile Include="Reservations\Model.fs" />
|
||||
|
||||
@@ -8,9 +8,7 @@ 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 =
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
module DredgePos.Global.View
|
||||
|
||||
open Giraffe.ViewEngine
|
||||
open DredgeFramework
|
||||
open Giraffe.ViewEngine
|
||||
|
||||
let Value = attr "data-value"
|
||||
|
||||
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 innerText = str
|
||||
let lang key = language.get key |> str
|
||||
|
||||
let template = tag "template"
|
||||
|
||||
let scriptToHTML (scriptFile: string) =
|
||||
let scriptPath = $"/scripts/{scriptFile}"
|
||||
match FileExists ("wwwroot" + scriptPath) with
|
||||
@@ -89,6 +95,10 @@ let keyboards = [|
|
||||
alert
|
||||
|]
|
||||
|
||||
let posButton (extraClasses: string) attrs content =
|
||||
let allAttrs = [_class $"posButton {extraClasses}"] |> List.append attrs
|
||||
a allAttrs content
|
||||
|
||||
let HtmlPage pageTitle scripts styles tags content =
|
||||
html [] [
|
||||
head [] [
|
||||
|
||||
@@ -11,7 +11,7 @@ let getOrderScreenData (tableNumber: int) =
|
||||
order_screen_pages = Entity.GetAllInVenue<order_screen_page_group>
|
||||
sales_categories = Entity.GetAllInVenue<sales_category>
|
||||
print_groups = Entity.GetAllInVenue<print_group>
|
||||
custom_item = Entity.GetAllByColumn<item> "item_code" "OPEN000" |> first
|
||||
custom_item = Entity.GetAllByColumn<item> "code" "OPEN000" |> first
|
||||
table = Floorplan.Model.getTable tableNumber
|
||||
|}
|
||||
|> ajaxSuccess
|
||||
|
||||
@@ -17,7 +17,7 @@ let getImageButtonData (button: button) =
|
||||
if button.primary_action = "item" then button.primary_action_value
|
||||
else button.secondary_action_value
|
||||
|
||||
let item = Entity.GetAllByColumn<item> "item_code" itemCode
|
||||
let item = Entity.GetAllByColumn<item> "code" itemCode
|
||||
|> first
|
||||
|
||||
let extraData =
|
||||
|
||||
108
OrderScreen/View.fs
Normal file
108
OrderScreen/View.fs
Normal file
@@ -0,0 +1,108 @@
|
||||
module DredgePos.OrderScreen.View
|
||||
|
||||
open DredgePos.Types
|
||||
open DredgePos.Global.View
|
||||
open DredgePos.Global.Controller
|
||||
open Giraffe.ViewEngine
|
||||
open language
|
||||
|
||||
let pageContainer orderNumber (clerk: clerk) =
|
||||
div [_id "pageContainer"] [
|
||||
div [_id "leftColumn"] [
|
||||
h1 [_class "tableHeading"] [str (string orderNumber)]
|
||||
div [_class "tableInfo"] [
|
||||
(* Cover Change Button *)
|
||||
posButton "" [] [str (getAndReplace "logged_in_as" [clerk.name])]
|
||||
]
|
||||
div [_class "orderBox"] [
|
||||
table [_class "orderBoxTable"] [
|
||||
thead [] [
|
||||
tr [] [
|
||||
th [_class "orderBoxCell qtyCell"] [str (get "qty_header")]
|
||||
th [_class "orderBoxCell itemIdCell"] [str (get "id_header")]
|
||||
th [_class "orderBoxCell itemCell"] [str (get "item_header")]
|
||||
th [_class "orderBoxCell unitPriceCell"] [str (get "price_header")]
|
||||
th [_class "orderBoxCell totalPriceCell"] [str (get "total_price_header")]
|
||||
th [_class "orderBoxCell printGroupCell"] [str (get "printgroup_header")]
|
||||
]
|
||||
]
|
||||
tbody [] []
|
||||
]
|
||||
]
|
||||
div [_class "orderBoxInfo"] [
|
||||
span [_class "voidModeWarning"; VisibleInMode ["void"]] [str (get "void_mode")]
|
||||
]
|
||||
div [_class "orderBoxFooter"] [
|
||||
span [_class "totalPrice"] [str (getAndReplace "totalPrice" ["0.00"])]
|
||||
small [_class "selectedPrice"] [str (getAndReplace "selectedPrice" ["0.00"])]
|
||||
|
||||
]
|
||||
]
|
||||
div [_id "rightColumn"] [
|
||||
div [_id "topHalf"] [
|
||||
div [_class "functionButtons"] [
|
||||
div [_class "printGroupButtons toggleGroup"] [
|
||||
input [_type "hidden"; _class "value"]
|
||||
(* Sales category override buttons *)
|
||||
]
|
||||
div [_class "functionColumn"] [
|
||||
posButton "accumulateButton" [ActiveInMode "accumulate"] [str (get "accumulate_function")]
|
||||
posButton "showCoverSelectorButton" [] [str (get "select_covers")]
|
||||
]
|
||||
div [_class "functionColumn"] [
|
||||
posButton "voidButton" [ActiveInMode "void"] [str (get "void")]
|
||||
posButton "open_item_button" [] [str (get "custom_item_button")]
|
||||
posButton "freetextButton" [] [str (get "freetext_button")]
|
||||
posButton "numpadButton" [] [str (get "numpad_button")]
|
||||
]
|
||||
div [_class "functionColumn"] [
|
||||
posButton "" [] ["pay_function" |> get |> str]
|
||||
posButton "" [] ["print_function" |> get |> str]
|
||||
]
|
||||
]
|
||||
div [_id "pageList"] [
|
||||
(* Category List *)
|
||||
]
|
||||
div [_id "pageGroupContainer"] [
|
||||
(* Page Groups *)
|
||||
]
|
||||
div [_class "pagNavigation"] [
|
||||
posButton "prevButton" [] ["prev_page" |> get |> str]
|
||||
posButton "nextButton" [] ["next_page" |> get |> str]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
(* Grid Container, Cover Selector *)
|
||||
|
||||
let posButtonTemplate =
|
||||
template [_id "posButtonTemplate"] [
|
||||
posButton "" [] []
|
||||
]
|
||||
|
||||
let gridContainer =
|
||||
div [_class "gridContainer"] [
|
||||
div [_class "gridContainerHeader"] [
|
||||
span [] []
|
||||
div [_class "posButton closeGrid"] [str "×"]
|
||||
]
|
||||
div [_class "gridContainerGrid"] [
|
||||
div [_class "pageGroup"] []
|
||||
]
|
||||
div [_class "pageNavigation"] [
|
||||
posButton "prevButton" [] ["prev_page" |> get |> str]
|
||||
posButton "nextButton" [] ["next_page" |> get |> str]
|
||||
]
|
||||
]
|
||||
|
||||
let coverSelector =
|
||||
div [_class "coverSelector"] []
|
||||
|
||||
let index orderNumber clerk styles scripts tags =
|
||||
[|
|
||||
pageContainer orderNumber clerk
|
||||
posButtonTemplate
|
||||
gridContainer
|
||||
coverSelector
|
||||
|]
|
||||
|> HtmlPage "Order" (GetScripts scripts) (GetStyles styles) (GetMetaTags tags)
|
||||
Reference in New Issue
Block a user