diff --git a/src/Handler/Admin.hs b/src/Handler/Admin.hs index 8142753..5797965 100644 --- a/src/Handler/Admin.hs +++ b/src/Handler/Admin.hs @@ -49,14 +49,21 @@ data AbstractTypeForm = , abstractTypeFormDuration :: Word64 } deriving Show -abstractTypeForm :: Form AbstractTypeForm -abstractTypeForm = +mkAbstractTypeForm' :: AbstractType -> Form AbstractTypeForm +mkAbstractTypeForm' at = mkAbstractTypeForm (Just $ abstractTypeName at) (Just $ (unpackTalkDuration . abstractTypeDuration) at) + +mkAbstractTypeForm :: Maybe Text -> Maybe Word64 -> Form AbstractTypeForm +mkAbstractTypeForm atName atDuration = renderDivs $ AbstractTypeForm <$> areq textField (named "talk-type-name" - (placeheld "Talk type name: ")) Nothing + (placeheld "Talk type name: ")) + atName <*> areq intField (named "talk-duration" - (placeheld "Talk type duration in minutes: ")) Nothing + (placeheld "Talk type duration in minutes: ")) + atDuration + +abstractTypeForm = mkAbstractTypeForm Nothing Nothing renderConferenceAbstractTypes :: Entity Conference @@ -84,7 +91,28 @@ renderConferenceAbstractTypes conf@(Entity conferenceId _) $else