maximum length of 100 for all inputs
This commit is contained in:
parent
583506df02
commit
ad73073f1d
1 changed files with 3 additions and 4 deletions
|
|
@ -30,7 +30,6 @@ import qualified System.Environment as S
|
||||||
|
|
||||||
staticFolderLoc = "../client/static"
|
staticFolderLoc = "../client/static"
|
||||||
|
|
||||||
|
|
||||||
getPollForBallot :: P.PollId -> AppM P.CreatePollInfo
|
getPollForBallot :: P.PollId -> AppM P.CreatePollInfo
|
||||||
getPollForBallot pollId = do
|
getPollForBallot pollId = do
|
||||||
db <- Rd.asks db
|
db <- Rd.asks db
|
||||||
|
|
@ -92,7 +91,7 @@ pageHead = head_ $ do
|
||||||
|
|
||||||
optionInput :: L.Html ()
|
optionInput :: L.Html ()
|
||||||
optionInput = div_ $
|
optionInput = div_ $
|
||||||
input_ [required_ "true", name_ "options"] <>
|
input_ [required_ "true", name_ "options", maxlength_ "100"] <>
|
||||||
with button_ [classes_ ["btn", "btn-warning-outline"], hxGet_ "create/removeInput", hxSwap_ "delete", hxTarget_ "closest #options-create > *"] "remove"
|
with button_ [classes_ ["btn", "btn-warning-outline"], hxGet_ "create/removeInput", hxSwap_ "delete", hxTarget_ "closest #options-create > *"] "remove"
|
||||||
|
|
||||||
createPage :: AppM (L.Html ())
|
createPage :: AppM (L.Html ())
|
||||||
|
|
@ -101,8 +100,8 @@ createPage = pure $ do
|
||||||
with body_ [classes_ ["container", "container-sm", "paper"], hxExt_ "json-enc"] $ do
|
with body_ [classes_ ["container", "container-sm", "paper"], hxExt_ "json-enc"] $ do
|
||||||
h2_ "create a poll"
|
h2_ "create a poll"
|
||||||
with form_ [id_ "inputs", hxPost_ "/create", hxTarget_ "body"] $ do
|
with form_ [id_ "inputs", hxPost_ "/create", hxTarget_ "body"] $ do
|
||||||
with label_ [for_ "title"] "title (optional)" <> input_ [name_ "title", type_ "text"]
|
with label_ [for_ "title"] "title (optional)" <> input_ [name_ "title", type_ "text", maxlength_ "100"]
|
||||||
with label_ [for_ "question"] "question" <> input_ [name_ "question", type_ "text", required_ "true"]
|
with label_ [for_ "question"] "question" <> input_ [name_ "question", type_ "text", required_ "true", maxlength_ "100"]
|
||||||
with fieldset_ [name_ "options", id_ "options-create"] $ do
|
with fieldset_ [name_ "options", id_ "options-create"] $ do
|
||||||
legend_ "options"
|
legend_ "options"
|
||||||
optionInput
|
optionInput
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue