Order Screen fully ported to Giraffe View Engine

This commit is contained in:
2022-07-02 14:22:52 +10:00
parent 905adcd7bd
commit 6c7bb9eff4
12 changed files with 117 additions and 239 deletions

19
Entities/Buttons/Model.fs Normal file
View File

@@ -0,0 +1,19 @@
module DredgePos.Entities.Buttons.Model
open DredgePos.Types
open DredgeFramework
let attr = Giraffe.ViewEngine.HtmlElements.attr
let getItemActionAttributes (itemCode: string) =
let item = Entity.GetFirstByColumn<item> "code" (StringTrim itemCode)
[(attr "data-item") <| jsonEncode item]
let getGridActionAttributes (gridId: int) = [(attr "data-grid") <| jsonEncode gridId]
let getActionAttributes (action: string) (actionValue: string) =
match action with
| "item" -> getItemActionAttributes actionValue
| "grid" -> actionValue |> int |> getGridActionAttributes
| _ -> []