generated from coulomb/repo-seed
Fix compilation errors across 6 controllers and 29 views: import cleanup, ResponseException pattern for API auth, type fixes, unused import removal. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
884 B
Haskell
30 lines
884 B
Haskell
module Web.View.StewardshipRoles.New where
|
|
|
|
import Web.View.Prelude
|
|
import Web.Routes ()
|
|
|
|
data NewView = NewView
|
|
{ role :: !StewardshipRole
|
|
, hubs :: ![Hub]
|
|
}
|
|
|
|
instance View NewView where
|
|
html NewView { .. } = [hsx|
|
|
<div class="max-w-lg">
|
|
<h1 class="text-2xl font-semibold mb-6">Grant Stewardship Role</h1>
|
|
{renderForm role hubs}
|
|
</div>
|
|
|]
|
|
|
|
renderForm :: StewardshipRole -> [Hub] -> Html
|
|
renderForm role hubs = formFor role [hsx|
|
|
{(selectField #hubId (hubOptions hubs)){ fieldLabel = "Hub" }}
|
|
{(textField #roleName){ helpText = "e.g. Hub Lead, Policy Steward, Triage Owner" }}
|
|
{(textField #assignedTo){ helpText = "Person name or identifier" }}
|
|
{(textareaField #notes){ fieldLabel = "Notes (optional)" }}
|
|
{submitButton}
|
|
|]
|
|
|
|
hubOptions :: [Hub] -> [(Text, Id Hub)]
|
|
hubOptions = map (\h -> (h.name, h.id))
|