clckwrks 0.13.0 → 0.13.2
raw patch · 4 files changed
+15/−17 lines, 4 filesdep ~hsx-jmacrodep ~jmacro
Dependency ranges changed: hsx-jmacro, jmacro
Files
- Clckwrks/Admin/PreviewPage.hs +11/−3
- Clckwrks/Admin/Route.hs +1/−1
- Clckwrks/Monad.hs +0/−10
- clckwrks.cabal +3/−3
Clckwrks/Admin/PreviewPage.hs view
@@ -9,10 +9,12 @@ import Clckwrks.ProfileData.Acid (HasRole(..)) import Clckwrks.Page.Acid (Page(..), PublishStatus(..), PageById(..)) import Clckwrks.Unauthorized ()+import Control.Monad.State (get) import qualified Data.Set as Set+import Web.Plugins.Core (getTheme) -previewPage :: Clck ClckURL Response -> PageId -> Clck ClckURL Response-previewPage pageHandler pid =+previewPage :: PageId -> Clck ClckURL Response+previewPage pid = do mPage <- query $ PageById pid case mPage of Nothing -> do notFound ()@@ -25,5 +27,11 @@ (Just uid) -> query $ HasRole uid (Set.singleton Administrator) if authorized then do setCurrentPage pid- pageHandler+ cs <- get+ ttl <- getPageTitle+ bdy <- getPageContent+ mTheme <- getTheme (plugins cs)+ case mTheme of+ Nothing -> escape $ internalServerError $ toResponse "No theme package is loaded."+ (Just theme) -> fmap toResponse $ unXMLGenT $ (_themeTemplate theme ttl () bdy) else unauthorized (toResponse $ "Sorry, you need Administrator access to view this page.")
Clckwrks/Admin/Route.hs view
@@ -22,7 +22,7 @@ EditFeedConfig -> editFeedConfig (Admin url) EditSettings -> editSettings (Admin url) NewPage -> nestURL Admin $ newPage PlainPage--- (PreviewPage pid) -> previewPage pageHandler pid -- FIXME+ (PreviewPage pid) -> previewPage pid -- FIXME NewPost -> nestURL Admin $ newPage Post Pages -> nestURL Admin $ pages EditMenu ->
Clckwrks/Monad.hs view
@@ -55,7 +55,6 @@ import Control.Monad.Reader (MonadReader, ReaderT, mapReaderT) import Control.Monad.Trans (MonadIO(liftIO), lift) import Control.Concurrent.STM (TVar, readTVar, writeTVar, atomically)-import Data.Aeson (Value(..)) import Data.Acid (AcidState, EventState, EventResult, QueryEvent, UpdateEvent) import Data.Acid.Advanced (query', update') import Data.Attoparsec.Text.Lazy (Parser, parseOnly, char, stringCI, try, takeWhile, takeWhile1)@@ -246,15 +245,6 @@ instance IntegerSupply (Clck url) where nextInteger = getUnique--instance ToJExpr Value where- toJExpr (Object obj) = ValExpr $ JHash $ Map.fromList $ map (\(k,v) -> (T.unpack k, toJExpr v)) (HashMap.toList obj)- toJExpr (Array vs) = ValExpr $ JList $ map toJExpr (Vector.toList vs)- toJExpr (String s) = ValExpr $ JStr $ T.unpack s- toJExpr (Number n) = ValExpr $ JDouble $ realToFrac n- toJExpr (Bool True) = ValExpr $ JVar $ StrI "true"- toJExpr (Bool False) = ValExpr $ JVar $ StrI "false"- toJExpr Null = ValExpr $ JVar $ StrI "null" instance ToJExpr Text.Text where toJExpr t = ValExpr $ JStr $ T.unpack t
clckwrks.cabal view
@@ -1,5 +1,5 @@ Name: clckwrks-Version: 0.13.0+Version: 0.13.2 Synopsis: A secure, reliable content management system (CMS) and blogging platform Description: clckwrks (pronounced, clockworks) aims to compete directly with popular PHP-based blogging and CMS@@ -88,9 +88,9 @@ happstack-server >= 7.0 && < 7.2, hsp == 0.7.*, hsx == 0.10.*,- hsx-jmacro == 7.1.*,+ hsx-jmacro == 7.2.*, ixset == 1.0.*,- jmacro == 0.5.*,+ jmacro == 0.6.*, mtl >= 2.0 && < 2.3, network >= 2.3 && < 2.5, old-locale == 1.0.*,