eidolon/Handler/Tag.hs

17 lines
425 B
Haskell
Raw Normal View History

2014-09-14 03:03:13 +00:00
module Handler.Tag where
import Import
import Data.Maybe
getTagR :: Text -> Handler Html
getTagR tag = do
tempMedia <- runDB $ selectList [] [Desc 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")