29 lines
753 B
Haskell
29 lines
753 B
Haskell
|
|
module Web.View.HubRoutingRules.Edit where
|
||
|
|
|
||
|
|
import Web.Types
|
||
|
|
import Generated.Types
|
||
|
|
import IHP.Prelude
|
||
|
|
import IHP.ViewPrelude
|
||
|
|
|
||
|
|
data EditView = EditView
|
||
|
|
{ rule :: !HubRoutingRule
|
||
|
|
, hubs :: ![Hub]
|
||
|
|
}
|
||
|
|
|
||
|
|
instance View EditView where
|
||
|
|
html EditView { .. } = [hsx|
|
||
|
|
<div class="max-w-lg">
|
||
|
|
<h1 class="text-2xl font-semibold mb-6">Edit Routing Rule</h1>
|
||
|
|
{renderForm rule}
|
||
|
|
</div>
|
||
|
|
|]
|
||
|
|
|
||
|
|
renderForm :: HubRoutingRule -> Html
|
||
|
|
renderForm rule = formFor rule [hsx|
|
||
|
|
{(textField #matchCategory){ helpText = "Leave blank to match any category" }}
|
||
|
|
{(textField #matchWidgetType){ helpText = "Leave blank to match any widget type" }}
|
||
|
|
{numberField #priority}
|
||
|
|
{textareaField #notes}
|
||
|
|
{submitButton}
|
||
|
|
|]
|