module Web.View.HubRoutingRules.New where
import Web.Types
import Generated.Types
import IHP.Prelude
import IHP.ViewPrelude
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){ label = "Source Hub" }}
{(selectField #targetHubId hubs){ label = "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}
|]