2026-03-29 10:38:50 +00:00
|
|
|
module Web.View.DecisionRecords.Edit where
|
|
|
|
|
|
|
|
|
|
import Web.Types
|
|
|
|
|
import Generated.Types
|
|
|
|
|
import IHP.Prelude
|
|
|
|
|
import IHP.ViewPrelude
|
2026-04-04 09:55:12 +00:00
|
|
|
import Web.Routes ()
|
2026-03-29 10:38:50 +00:00
|
|
|
import Web.View.DecisionRecords.New (renderForm)
|
|
|
|
|
|
|
|
|
|
data EditView = EditView
|
|
|
|
|
{ record :: !DecisionRecord
|
|
|
|
|
, requirements :: ![Requirement]
|
|
|
|
|
, candidates :: ![RequirementCandidate]
|
|
|
|
|
, users :: ![User]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
instance View EditView where
|
2026-04-29 10:46:50 +02:00
|
|
|
html EditView { .. } =
|
|
|
|
|
let formAction = UpdateDecisionRecordAction { decisionRecordId = record.id }
|
|
|
|
|
in [hsx|
|
2026-03-29 10:38:50 +00:00
|
|
|
<div class="mb-6 flex items-center gap-2 text-sm text-gray-500">
|
|
|
|
|
<a href={DecisionRecordsAction} class="hover:text-gray-700">Decisions</a>
|
|
|
|
|
<span>/</span>
|
2026-04-04 09:55:12 +00:00
|
|
|
<a href={ShowDecisionRecordAction (record.id)}
|
2026-03-29 10:38:50 +00:00
|
|
|
class="hover:text-gray-700">{record.title}</a>
|
|
|
|
|
<span>/</span>
|
|
|
|
|
<span>Edit</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="max-w-2xl">
|
|
|
|
|
<h1 class="text-2xl font-semibold mb-2">Edit Decision Record</h1>
|
|
|
|
|
<p class="text-sm text-amber-600 mb-6">
|
|
|
|
|
Note: outcome is immutable and cannot be changed here.
|
|
|
|
|
</p>
|
2026-04-29 10:46:50 +02:00
|
|
|
{renderForm record requirements candidates users formAction}
|
2026-03-29 10:38:50 +00:00
|
|
|
</div>
|
|
|
|
|
|]
|