eidolon/Handler/Tag.hs
2014-12-28 07:12:25 +01:00

17 lines
496 B
Haskell

module Handler.Tag where
import Import
import qualified Data.Text as T
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
setTitle $ toHtml ("Eidolon :: Tag " `T.append` tag)
$(widgetFile "tagMedia")