From d8d4b5b306d469f6387ffcb9e5fa7466549ec4a5 Mon Sep 17 00:00:00 2001 From: nek0 Date: Mon, 18 Aug 2014 13:17:54 +0200 Subject: [PATCH] albummedia now displayed correctly, but talking with DB is ugly --- Handler/Album.hs | 3 ++- templates/album.hamlet | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Handler/Album.hs b/Handler/Album.hs index a258e65..85a0d02 100644 --- a/Handler/Album.hs +++ b/Handler/Album.hs @@ -17,7 +17,8 @@ getAlbumR albumId = do return (userId == ownerId) Nothing -> return False - media <- mapM (\a -> runDB $ getJust a) (albumContent album) +-- media <- mapM (\a -> runDB $ getJust a) (albumContent album) + media <- runDB $ selectList [MediumAlbum ==. albumId] [Desc MediumTime] defaultLayout $ do $(widgetFile "album") Nothing -> do diff --git a/templates/album.hamlet b/templates/album.hamlet index 6734980..e20bb1c 100644 --- a/templates/album.hamlet +++ b/templates/album.hamlet @@ -9,7 +9,8 @@ by #{ownerName} This album is empty $else Images in this album: - $forall (medium) <- media + $forall (Entity mediumId medium) <- media
+
#{mediumTitle medium}