28 lines
751 B
Haskell
28 lines
751 B
Haskell
|
|
module Web.View.FederatedPolicyOverlays.New where
|
||
|
|
|
||
|
|
import Web.Types
|
||
|
|
import Generated.Types
|
||
|
|
import IHP.Prelude
|
||
|
|
import IHP.ViewPrelude
|
||
|
|
|
||
|
|
data NewView = NewView
|
||
|
|
{ overlay :: !FederatedPolicyOverlay
|
||
|
|
, hubs :: ![Hub]
|
||
|
|
}
|
||
|
|
|
||
|
|
instance View NewView where
|
||
|
|
html NewView { .. } = [hsx|
|
||
|
|
<div class="max-w-2xl">
|
||
|
|
<h1 class="text-2xl font-semibold mb-6">New Policy Overlay</h1>
|
||
|
|
{renderForm overlay}
|
||
|
|
</div>
|
||
|
|
|]
|
||
|
|
|
||
|
|
renderForm :: FederatedPolicyOverlay -> Html
|
||
|
|
renderForm overlay = formFor overlay [hsx|
|
||
|
|
{textField #title}
|
||
|
|
{(textareaField #policyText){ helpText = "Full policy text; once activated this cannot be changed" }}
|
||
|
|
{(textareaField #notes){ label = "Notes (optional)" }}
|
||
|
|
{submitButton}
|
||
|
|
|]
|