Form-Identifiers introduced
This commit is contained in:
parent
52be9e3198
commit
1b272c6ee8
@ -233,8 +233,7 @@ courseToForm cEntity = CourseForm
|
|||||||
course = entityVal cEntity
|
course = entityVal cEntity
|
||||||
|
|
||||||
newCourseForm :: Maybe CourseForm -> Form CourseForm
|
newCourseForm :: Maybe CourseForm -> Form CourseForm
|
||||||
newCourseForm template = -- identifyForm "newCourseForm" $
|
newCourseForm template = identForm FIDcourse $ \html -> do
|
||||||
\html -> do
|
|
||||||
-- mopt hiddenField
|
-- mopt hiddenField
|
||||||
-- cidKey <- getsYesod appCryptoIDKey
|
-- cidKey <- getsYesod appCryptoIDKey
|
||||||
-- courseId <- runMaybeT $ do
|
-- courseId <- runMaybeT $ do
|
||||||
|
|||||||
@ -24,6 +24,17 @@ import Yesod.Form.Bootstrap3
|
|||||||
|
|
||||||
import Web.PathPieces (showToPathPiece, readFromPathPiece)
|
import Web.PathPieces (showToPathPiece, readFromPathPiece)
|
||||||
|
|
||||||
|
------------------------------------------------
|
||||||
|
-- Unique Form Identifiers to avoid accidents --
|
||||||
|
------------------------------------------------
|
||||||
|
|
||||||
|
data FormIdentifier = FIDcourse
|
||||||
|
deriving (Enum, Eq, Ord, Bounded, Read, Show)
|
||||||
|
|
||||||
|
|
||||||
|
identForm :: FormIdentifier -> Form a -> Form a
|
||||||
|
identForm fid = identifyForm (T.pack $ show fid)
|
||||||
|
|
||||||
|
|
||||||
----------------------------
|
----------------------------
|
||||||
-- Buttons (new version ) --
|
-- Buttons (new version ) --
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user