Make field readonly, not disabled
Working on Windows horriblness all day sure did nice things to my mood, didn't it?
This commit is contained in:
parent
6ad6301cbd
commit
e8827c29c6
2 changed files with 9 additions and 1 deletions
|
@ -134,7 +134,8 @@ setRepoConfig uuid mremote oldc newc = do
|
||||||
|
|
||||||
editRepositoryAForm :: Bool -> RepoConfig -> MkAForm RepoConfig
|
editRepositoryAForm :: Bool -> RepoConfig -> MkAForm RepoConfig
|
||||||
editRepositoryAForm ishere def = RepoConfig
|
editRepositoryAForm ishere def = RepoConfig
|
||||||
<$> areq textField "Name" (Just $ repoName def)
|
<$> areq (if ishere then readonlyTextField else textField)
|
||||||
|
"Name" (Just $ repoName def)
|
||||||
<*> aopt textField "Description" (Just $ repoDescription def)
|
<*> aopt textField "Description" (Just $ repoDescription def)
|
||||||
<*> areq (selectFieldList groups `withNote` help) "Repository group" (Just $ repoGroup def)
|
<*> areq (selectFieldList groups `withNote` help) "Repository group" (Just $ repoGroup def)
|
||||||
<*> associateddirectory
|
<*> associateddirectory
|
||||||
|
|
|
@ -33,6 +33,13 @@ textField = F.textField
|
||||||
|]
|
|]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readonlyTextField :: MkField Text
|
||||||
|
readonlyTextField = F.textField
|
||||||
|
{ fieldView = \theId name attrs val _isReq -> [whamlet|
|
||||||
|
<input id="#{theId}" name="#{name}" *{attrs} type="text" value="#{either id id val}" readonly="true">
|
||||||
|
|]
|
||||||
|
}
|
||||||
|
|
||||||
{- Also without required attribute. -}
|
{- Also without required attribute. -}
|
||||||
passwordField :: MkField Text
|
passwordField :: MkField Text
|
||||||
passwordField = F.passwordField
|
passwordField = F.passwordField
|
||||||
|
|
Loading…
Reference in a new issue