web: EntryProposal form implementation.

This commit is contained in:
2021-10-26 01:46:59 -05:00
parent e055bee0f3
commit 3675c6054a
32 changed files with 705 additions and 203 deletions

View File

@ -10,6 +10,11 @@ type
date*: DateTime
budgetInDollars*: int
MultiSelectOption = tuple[value: string, color: string]
EventProposalConfig* = object
departmentOptions*: seq[MultiSelectOption]
proc getOrFail(n: JsonNode, key: string): JsonNode =
## convenience method to get a key from a JObject or raise an exception
if not n.hasKey(key):
@ -75,3 +80,14 @@ proc asNotionPage*(ep: EventProposal): JsonNode =
}
]
}
proc `%`(mso: MultiSelectOption): JsonNode =
%*{
"value": mso.value,
"color": mso.color
}
proc `%`*(epc: EventProposalConfig): JsonNode =
%*{
"departments": epc.departmentOptions
}