Order Screen fully ported to Giraffe View Engine
This commit is contained in:
19
Entities/Buttons/Model.fs
Normal file
19
Entities/Buttons/Model.fs
Normal 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
|
||||
| _ -> []
|
||||
Reference in New Issue
Block a user