lambdacms-media 0.3.0.1 → 0.4.0.0
raw patch · 8 files changed
+31/−22 lines, 8 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- LICENSE +1/−1
- LambdaCms/Media/Foundation.hs +1/−1
- LambdaCms/Media/Handler/Media.hs +5/−5
- README.md +18/−9
- config/routes +1/−1
- lambdacms-media.cabal +3/−3
- templates/edit.hamlet +1/−1
- templates/new.hamlet +1/−1
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2015 Hoppinger BV, http://lambdacms.org+Copyright (c) 2014-2015 Hoppinger BV, http://lambdacms.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
LambdaCms/Media/Foundation.hs view
@@ -56,7 +56,7 @@ renderMediaMessage _ _ = defaultMessage defaultMediaAdminMenu :: LambdaCmsMedia master => (Route MediaAdmin -> Route master) -> [AdminMenuItem master]-defaultMediaAdminMenu tp = [ MenuItem (SomeMessage Msg.MenuMedia) (tp MediaAdminR) "picture" ]+defaultMediaAdminMenu tp = [ MenuItem (SomeMessage Msg.MenuMedia) (tp MediaAdminIndexR) "picture" ] attachedMaybeMedia :: LambdaCmsMedia master => model
LambdaCms/Media/Handler/Media.hs view
@@ -6,7 +6,7 @@ {-# LANGUAGE FlexibleContexts #-} module LambdaCms.Media.Handler.Media- ( getMediaAdminR+ ( getMediaAdminIndexR , getMediaAdminNewR , postMediaAdminNewR , getMediaAdminEditR@@ -25,7 +25,7 @@ import System.FilePath -getMediaAdminR :: MediaHandler Html+getMediaAdminIndexR :: MediaHandler Html getMediaAdminNewR :: MediaHandler Html postMediaAdminNewR :: MediaHandler Html getMediaAdminEditR :: MediaId -> MediaHandler Html@@ -33,7 +33,7 @@ deleteMediaAdminEditR :: MediaId -> MediaHandler Html patchMediaAdminRenameR :: MediaId -> MediaHandler Html -getMediaAdminR = lift $ do+getMediaAdminIndexR = lift $ do can <- getCan -- Following line needs +XFlexibleContexts in GHC 7.10+ let indexItem file mroute = $(widgetFile "index_item")@@ -57,7 +57,7 @@ (location, ctype) <- upload fileF (unpack nameF) _ <- lift . runDB . insert $ Media location ctype labelF descriptionF now lift . setMessageI $ Msg.SaveSuccess labelF- redirect MediaAdminR+ redirect MediaAdminIndexR _ -> lift $ do can <- getCan adminLayout $ do@@ -98,7 +98,7 @@ case isDeleted of True -> do lift . setMessageI $ Msg.DeleteSuccess (mediaLabel file)- redirect MediaAdminR+ redirect MediaAdminIndexR False -> do lift . setMessageI $ Msg.DeleteFail (mediaLabel file) redirect $ MediaAdminEditR fileId
README.md view
@@ -1,9 +1,11 @@ lambdacms-media =============== -This is an extension for [LambdaCms](http://lambdacms.org) which allows admins to manage media files.+This is an extension for [LambdaCms](http://lambdacms.org) which allows admins to+manage media files. -**NOTE:** At this point the functionality provided by this extension is very basic. Pull request adding features are most welcome.+**NOTE:** At this point the functionality provided by this extension is very basic.+Pull requests adding features are most welcome. ### Installing@@ -18,19 +20,25 @@ line to `build-depends`: ```- , lambdacms-media >= 0.2.0 && < 0.3+ , lambdacms-media ``` The media extension's admin section needs to be mounted in the base app's router, therefor add the following line to your `config/routes` file: ```-/admin/media MediaAdminSubR MediaAdmin getLambdaCmsMedia+/admin/media MediaAdminR MediaAdmin getLambdaCmsMedia ``` -To `Application.hs` add `import LambdaCms.Media` and the following line:+To `Application.hs` add: ```haskell+import LambdaCms.Media+```++As well as the following line (see the comment):++```haskell ... let getLambdaCms = CoreAdmin getLambdaCmsMedia = MediaAdmin -- add this line@@ -38,7 +46,7 @@ ... ``` -The procede by including the `migrateLambdaCmsMedia` function to `Application.hs`+Then proceed by including the `migrateLambdaCmsMedia` function to `Application.hs` as shown in this snippet: ```haskell@@ -50,7 +58,8 @@ ``` -To `Foundation.hs` also add `import LambdaCms.Media` and the following two lines:+To `Foundation.hs` also add `import LambdaCms.Media` and the following two+lines (see comments): ```haskell ...@@ -70,7 +79,7 @@ ```haskell instance LambdaCmsMedia App where- mediaR = MediaAdminSubR+ mediaR = MediaAdminR staticDir y = appStaticDir $ appSettings y staticRoot _ = "/static" ```@@ -114,6 +123,6 @@ ### License All code in this repository is released under the MIT license, as specified-in the [LICENSE file](https://github.com/lambdacms/lambdacms-core/blob/master/LICENSE).+in the [LICENSE file](https://github.com/lambdacms/lambdacms/blob/master/LICENSE).
config/routes view
@@ -1,4 +1,4 @@-/ MediaAdminR GET+/ MediaAdminIndexR GET /new MediaAdminNewR GET POST /#MediaId/rename MediaAdminRenameR PATCH !/#MediaId MediaAdminEditR GET PATCH DELETE
lambdacms-media.cabal view
@@ -1,11 +1,11 @@ name: lambdacms-media-version: 0.3.0.1+version: 0.4.0.0 license: MIT license-file: LICENSE author: Mats Rietdijk, Cies Breijs maintainer: mats@AT-hoppinger.com copyright: (c) 2014-2015 Hoppinger BV-bug-reports: https://github.com/lambdacms/lambdacms-media/issues+bug-reports: https://github.com/lambdacms/lambdacms/issues homepage: http://lambdacms.org synopsis: LambdaCms "media" extension description: LambdaCms is a Content Management System (CMS) in Haskell@@ -24,7 +24,7 @@ source-repository head type: git- location: git://github.com/lambdacms/lambdacms-media.git+ location: git://github.com/lambdacms/lambdacms.git library default-language: Haskell2010
templates/edit.hamlet view
@@ -1,6 +1,6 @@ <div .row> <div .col-xs-12>- $maybe r <- can (mediaR MediaAdminR) "GET"+ $maybe r <- can (mediaR MediaAdminIndexR) "GET" <a href=@{r}> <span .glyphicon .glyphicon-arrow-left> _{Msg.Back}
templates/new.hamlet view
@@ -1,6 +1,6 @@ <div .row> <div .col-xs-12>- $maybe r <- can (mediaR MediaAdminR) "GET"+ $maybe r <- can (mediaR MediaAdminIndexR) "GET" <a href=@{r}> <span .glyphicon .glyphicon-arrow-left> _{Msg.Back}