Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2 from ahodgen/Yesod_1_1

Yesod 1 1
  • Loading branch information...
commit 64203d8bcd4cb26c9b1df81416eecc986b00faf3 2 parents 0283051 + ceac45b
@jgm authored
View
9 Network/Gitit2.hs
@@ -39,12 +39,14 @@ import Control.Applicative
import Control.Monad (when, unless, filterM, mplus, foldM)
import qualified Data.Text as T
import Data.Text (Text)
-import Data.ByteString.Lazy (ByteString)
+import Data.ByteString.Lazy (ByteString, fromChunks)
import qualified Data.ByteString.Lazy.Char8 as B
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BSC
import Data.ByteString.Lazy.UTF8 (toString)
import qualified Data.ByteString.UTF8 as BSU
+import Data.Conduit (($$))
+import Data.Conduit.List (consume)
import Text.Blaze.Html hiding (contents)
import Blaze.ByteString.Builder (toLazyByteString)
import Text.HTML.SanitizeXSS (sanitizeAttribute)
@@ -1287,7 +1289,7 @@ data Upload = Upload { uploadFile :: FileInfo
, uploadWikiname :: Text
, uploadDescription :: Text
, uploadOverwrite :: Bool
- } deriving Show
+ }
uploadForm :: HasGitit master
=> Maybe Upload
@@ -1332,7 +1334,8 @@ postUploadR = do
setMessageI MsgFileExists
showUploadForm enctype widget
else do
- res <- liftIO $ try $ save fs path auth comm $ fileContent fileinfo
+ cont <- lift $ fromChunks <$> (fileSource fileinfo $$ consume)
+ res <- liftIO $ try $ save fs path auth comm cont
case res of
Left FS.Unchanged -> do
setMessageI MsgFileUnchanged
View
37 gitit2.cabal
@@ -48,28 +48,29 @@ library
NoMonomorphismRestriction
build-depends: base >= 4 && < 5
- -- , yesod-platform >= 1.0 && < 1.1
- , yesod >= 1.0 && < 1.1
- , yesod-static >= 1.0 && < 1.1
- , yesod-default >= 1.0 && < 1.1
- , yesod-core >= 1.0 && < 1.1
- , yesod-form >= 1.0 && < 1.1
- , yesod-test >= 0.2 && < 0.3
- , clientsession >= 0.7.3 && < 0.8
+ -- , yesod-platform >= 1.1 && < 1.2
+ , yesod >= 1.1 && < 1.2
+ , yesod-static >= 1.1 && < 1.2
+ , yesod-default >= 1.1 && < 1.2
+ , yesod-core >= 1.1 && < 1.2
+ , yesod-form >= 1.1 && < 1.2
+ , yesod-test >= 0.3 && < 0.4
+ , clientsession >= 0.8 && < 0.9
, bytestring >= 0.9 && < 0.10
, text >= 0.11 && < 0.12
, template-haskell
- , hamlet >= 1.0 && < 1.1
+ , hamlet >= 1.1 && < 1.2
, shakespeare-css >= 1.0 && < 1.1
, shakespeare-js >= 1.0 && < 1.1
, shakespeare-text >= 1.0 && < 1.1
, hjsmin >= 0.1 && < 0.2
, monad-control >= 0.3 && < 0.4
- , wai-extra >= 1.2 && < 1.3
- , yaml >= 0.7 && < 0.9
- , http-conduit >= 1.4 && < 1.5
+ , wai-extra >= 1.3 && < 1.4
+ , yaml >= 0.8 && < 0.9
+ , conduit >= 0.5 && < 0.6
+ , http-conduit >= 1.6 && < 1.7
, directory >= 1.1 && < 1.2
- , warp >= 1.2 && < 1.3
+ , warp >= 1.3 && < 1.4
, filepath >= 1.3 && < 1.4
, filestore >= 0.5 && < 0.6
, utf8-string >= 0.3 && < 0.4
@@ -80,7 +81,7 @@ library
, pandoc >= 1.9.3 && < 1.10
, highlighting-kate >= 0.5.0.6 && < 0.6
, xss-sanitize >= 0.3.2 && < 0.4
- , yesod-newsfeed >= 1.0 && < 1.1
+ , yesod-newsfeed >= 1.1 && < 1.2
, time >= 1.1 && < 1.5
, syb >= 0.3 && < 0.4
, directory >= 1.1 && < 1.2
@@ -95,13 +96,13 @@ executable gitit2
main-is: gitit2.hs
hs-source-dirs: src
build-depends: base >= 4 && < 5
- , yesod >= 1.0 && < 1.1
- , yesod-static >= 1.0 && < 1.1
+ , yesod >= 1.1 && < 1.2
+ , yesod-static >= 1.1 && < 1.2
, filestore >= 0.5 && < 0.6
, containers >= 0.4 && < 0.5
- , yaml >= 0.7 && < 0.9
+ , yaml >= 0.8 && < 0.9
, bytestring >= 0.9 && < 1.0
- , warp >= 1.2 && < 1.3
+ , warp >= 1.3 && < 1.4
, text >= 0.11 && < 0.12
, directory >= 1.1 && < 1.2
, network >= 2.3 && < 2.4
View
BIN  src/.gitit2.hs.swp
Binary file not shown
View
4 src/gitit2.hs
@@ -30,7 +30,7 @@ mkYesod "Master" [parseRoutes|
instance Yesod Master where
defaultLayout contents = do
PageContent title headTags bodyTags <- widgetToPageContent $ do
- addWidget contents
+ contents
mmsg <- getMessage
hamletToRepHtml [hamlet|
$doctype 5
@@ -43,7 +43,7 @@ instance Yesod Master where
<p.message>#{msg}
^{bodyTags}
|]
- maximumContentLength x _ = maxUploadSize x
+ maximumContentLength x _ = fromIntegral $ maxUploadSize x
instance RenderMessage Master FormMessage where
renderMessage _ _ = defaultFormMessage
Please sign in to comment.
Something went wrong with that request. Please try again.