module Web.View.HubRoutingRules.New where import Web.Types import Generated.Types import IHP.Prelude import IHP.ViewPrelude import Web.Routes () data NewView = NewView { rule :: !HubRoutingRule , hubs :: ![Hub] } instance View NewView where html NewView { .. } = [hsx|

New Routing Rule

{renderForm rule hubs}
|] renderForm :: HubRoutingRule -> [Hub] -> Html renderForm rule hubs = formFor rule [hsx| {(selectField #sourceHubId hubs){ fieldLabel = "Source Hub" }} {(selectField #targetHubId hubs){ fieldLabel = "Target Hub" }} {(textField #matchCategory){ helpText = "Leave blank to match any category" }} {(textField #matchWidgetType){ helpText = "Leave blank to match any widget type" }} {(numberField #priority){ helpText = "Higher priority rules are evaluated first" }} {textareaField #notes} {submitButton} |]