module Web.View.Annotations.New where
import Web.Types
import Generated.Types
import IHP.Prelude
import IHP.ViewPrelude
data NewView = NewView
{ widget :: !Widget
, annotation :: !Annotation
}
instance View NewView where
html NewView { .. } = [hsx|
Add Annotation
{renderForm annotation widget.id}
|]
renderForm :: Annotation -> Id Widget -> Html
renderForm annotation widgetId = formFor annotation [hsx|
{(textareaField #body) { fieldLabel = "Comment" }}
{selectField #category categoryOptions}
{selectField #severity severityOptions}
{submitButton}
|]
categoryOptions :: [(Text, Text)]
categoryOptions =
[ ("Friction", "friction")
, ("Defect", "defect")
, ("Wish", "wish")
, ("Policy Concern", "policy_concern")
, ("Documentation Gap", "doc_gap")
, ("Trust", "trust")
, ("Other", "other")
]
severityOptions :: [(Text, Text)]
severityOptions =
[ ("Low", "low")
, ("Medium", "medium")
, ("High", "high")
, ("Critical", "critical")
]