tagField now can load tag lists
This commit is contained in:
parent
60505af237
commit
99398c1ecf
1 changed files with 3 additions and 2 deletions
|
@ -16,6 +16,7 @@ import Model
|
||||||
import Control.Applicative
|
import Control.Applicative
|
||||||
import Control.Monad.Trans.Class
|
import Control.Monad.Trans.Class
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
|
import Data.Either
|
||||||
import qualified Data.ByteString as B
|
import qualified Data.ByteString as B
|
||||||
import qualified Data.ByteString.Lazy as BL
|
import qualified Data.ByteString.Lazy as BL
|
||||||
import qualified Data.ByteString.Char8 as BC
|
import qualified Data.ByteString.Char8 as BC
|
||||||
|
@ -78,7 +79,7 @@ tagField = Field
|
||||||
case rawVals of
|
case rawVals of
|
||||||
[x] -> return $ Right $ Just $ T.splitOn " " x
|
[x] -> return $ Right $ Just $ T.splitOn " " x
|
||||||
_ -> return $ Left $ error "unexpected tag list"
|
_ -> return $ Left $ error "unexpected tag list"
|
||||||
, fieldView = \idAttr nameAttr _ eResult isReq ->
|
, fieldView = \idAttr nameAttr val eResult isReq ->
|
||||||
[whamlet|<input id=#{idAttr} type="text" name=#{nameAttr}>|]
|
[whamlet|<input id=#{idAttr} type="text" name=#{nameAttr} value=#{either id (T.intercalate " ") eResult}>|]
|
||||||
, fieldEnctype = UrlEncoded
|
, fieldEnctype = UrlEncoded
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue