Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed messages.

Now validation messages display again.
Switched from using lookRead to using looks for messages.

Closes #294.
  • Loading branch information...
commit 207494c3bea6de892e139e90979fde7cab7d9d28 1 parent 4da1762
John MacFarlane authored
Showing with 6 additions and 6 deletions.
  1. +5 −5 Network/Gitit/Framework.hs
  2. +1 −1  Network/Gitit/Types.hs
View
10 Network/Gitit/Framework.hs
@@ -322,21 +322,21 @@ guardBareBase = do
mzero
-- | Runs a server monad in a local context after setting
--- the "messages" request header.
+-- the "message" request header.
withMessages :: ServerMonad m => [String] -> m a -> m a
withMessages messages handler = do
req <- askRq
- let inps = filter (\(n,_) -> n /= "messages") $ rqInputsQuery req
- let newInp = ("messages", Input {
+ let inps = filter (\(n,_) -> n /= "message") $ rqInputsQuery req
+ let newInp msg = ("message", Input {
inputValue = Right
- $ LazyUTF8.fromString $ show messages
+ $ LazyUTF8.fromString msg
, inputFilename = Nothing
, inputContentType = ContentType {
ctType = "text"
, ctSubtype = "plain"
, ctParameters = [] }
})
- localRq (\rq -> rq{ rqInputsQuery = newInp : inps }) handler
+ localRq (\rq -> rq{ rqInputsQuery = map newInp messages ++ inps }) handler
-- | Returns a filestore object derived from the
-- repository path and filestore type specified in configuration.
View
2  Network/Gitit/Types.hs
@@ -316,7 +316,7 @@ instance FromData Params where
pa <- look' "patterns" `mplus` return ""
gt <- look' "gotopage" `mplus` return ""
ft <- look' "filetodelete" `mplus` return ""
- me <- lookRead "messages" `mplus` return []
+ me <- looks "message"
fm <- liftM Just (look' "from") `mplus` return Nothing
to <- liftM Just (look' "to") `mplus` return Nothing
et <- liftM (Just . filter (/='\r')) (look' "editedText")
Please sign in to comment.
Something went wrong with that request. Please try again.