eidolon/Handler/Tag.hs

18 lines
496 B
Haskell
Raw Normal View History

2014-09-14 03:03:13 +00:00
module Handler.Tag where
import Import
2014-09-24 21:03:18 +00:00
import qualified Data.Text as T
2014-09-14 03:03:13 +00:00
getTagR :: Text -> Handler Html
getTagR tag = do
2014-12-19 21:37:32 +00:00
tempMedia <- runDB $ selectList [] [Desc MediumTitle]
2014-09-14 03:03:13 +00:00
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
2014-09-24 21:03:18 +00:00
setTitle $ toHtml ("Eidolon :: Tag " `T.append` tag)
2014-09-14 03:03:13 +00:00
$(widgetFile "tagMedia")