Link-Buttons via CSS

This commit is contained in:
SJost 2017-11-17 16:17:16 +01:00
parent 05b912179f
commit 52be9e3198
2 changed files with 8 additions and 7 deletions

View File

@ -233,7 +233,8 @@ courseToForm cEntity = CourseForm
course = entityVal cEntity course = entityVal cEntity
newCourseForm :: Maybe CourseForm -> Form CourseForm newCourseForm :: Maybe CourseForm -> Form CourseForm
newCourseForm template = identifyForm "newCourseForm" $ \html -> do newCourseForm template = -- identifyForm "newCourseForm" $
\html -> do
-- mopt hiddenField -- mopt hiddenField
-- cidKey <- getsYesod appCryptoIDKey -- cidKey <- getsYesod appCryptoIDKey
-- courseId <- runMaybeT $ do -- courseId <- runMaybeT $ do

View File

@ -68,12 +68,12 @@ instance Button StandardButton where
-- LinkButton route = ??? -- LinkButton route = ???
linkButton :: Widget -> ButtonCssClass -> Route UniWorX -> Widget linkButton :: Widget -> ButtonCssClass -> Route UniWorX -> Widget
linkButton lbl cls url = do linkButton lbl cls url = [whamlet| <a href=@{url} .btn .#{bcc2txt cls} role=button>^{lbl} |]
[whamlet| -- [whamlet|
<form method=post action=@{url}> -- <form method=post action=@{url}>
<input type="hidden" name="_formid" value="identify-linkButton"> -- <input type="hidden" name="_formid" value="identify-linkButton">
<button .btn .#{bcc2txt cls} type=submit value="Link to @{url}">^{lbl} -- <button .btn .#{bcc2txt cls} type=submit value="Link to @{url}">^{lbl}
|] -- |]
-- <input .btn .#{bcc2txt cls} type="submit" value=^{lbl}> -- <input .btn .#{bcc2txt cls} type="submit" value=^{lbl}>