eidolon/Handler/Tag.hs
2014-09-21 18:42:07 +02:00

16 lines
424 B
Haskell

module Handler.Tag where
import Import
import Data.Maybe
getTagR :: Text -> Handler Html
getTagR tag = do
tempMedia <- runDB $ selectList [] [Asc MediumTitle]
almostMedia <- mapM (\a -> do
case tag `elem` (mediumTags $ entityVal a) of
True -> return (Just a)
False -> return Nothing
) tempMedia
media <- return $ removeItem Nothing almostMedia
defaultLayout $ do
$(widgetFile "tagMedia")