Join With Line function

This commit is contained in:
2022-02-13 13:09:53 +10:00
parent 445cbbabe5
commit 430ad87880
3 changed files with 7 additions and 5 deletions

View File

@@ -16,6 +16,8 @@ open Thoth.Json.Net
let (|?) lhs rhs = if lhs = null then rhs else lhs
let joinWithNewLine (arr: string[]) = arr |> String.concat "\n"
let getCurrentVenue () = 1
let map list = list |> Map.ofList

View File

@@ -109,7 +109,7 @@ let generateSalesCategoryOverrideButtons () =
Entity.GetAllInVenue<print_group>
|> Array.map printGroupPosButton
|> Array.append [|PosButton (language.getAndReplace "print_with" ["default"]) "printGroupOverrideButton toggle default active" """data-value="0" """|]
|> String.concat "\n"
|> joinWithNewLine
let renderGrid (grid: grid) =
@@ -123,7 +123,7 @@ let renderGrid (grid: grid) =
|> Array.map snd
|> Array.map(fun row -> row |> Array.map renderButton |> String.concat "\n")
|> Array.map (renderPage grid)
|> String.concat "\n"
|> joinWithNewLine
let loadGrid gridId = renderGrid (Entity.GetById<grid> gridId)

View File

@@ -22,7 +22,7 @@ let loadFloorplan (ctx: HttpContext) : HttpHandler =
let roomMenu =
Entity.GetAllInVenue<floorplan_room>
|> Array.map makeRoomButton
|> String.concat "\n"
|> joinWithNewLine
let variables = map [
"title", "Floorplan"
@@ -64,12 +64,12 @@ let loadOrderScreen (ctx: HttpContext) (tableNumber: int) : HttpHandler =
let categoryArray = map ["page", categoryMap]
Theme.loadTemplateWithArrays "orderScreen/page_group_button" categoryArray
)
|> String.concat "\n"
|> joinWithNewLine
let grids =
OrderScreen.getAllPageGrids ()
|> Array.map OrderScreen.getPagesHTML
|> String.concat "\n"
|> joinWithNewLine
let coverSelectorButtons =
Array.init (covers+1) id