35 lines
1.2 KiB
Haskell
35 lines
1.2 KiB
Haskell
|
|
module Web.View.DecisionRecords.Edit where
|
||
|
|
|
||
|
|
import Web.Types
|
||
|
|
import Generated.Types
|
||
|
|
import IHP.Prelude
|
||
|
|
import IHP.ViewPrelude
|
||
|
|
import Web.View.DecisionRecords.New (renderForm)
|
||
|
|
|
||
|
|
data EditView = EditView
|
||
|
|
{ record :: !DecisionRecord
|
||
|
|
, requirements :: ![Requirement]
|
||
|
|
, candidates :: ![RequirementCandidate]
|
||
|
|
, users :: ![User]
|
||
|
|
}
|
||
|
|
|
||
|
|
instance View EditView where
|
||
|
|
html EditView { .. } = [hsx|
|
||
|
|
<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>
|
||
|
|
<a href={ShowDecisionRecordAction { decisionRecordId = record.id }}
|
||
|
|
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>
|
||
|
|
{renderForm record requirements candidates users (UpdateDecisionRecordAction { decisionRecordId = record.id })}
|
||
|
|
</div>
|
||
|
|
|]
|