albummedia now displayed correctly, but talking with DB is ugly

This commit is contained in:
nek0 2014-08-18 13:17:54 +02:00
parent 72e4f16125
commit d8d4b5b306
2 changed files with 4 additions and 2 deletions

View file

@ -17,7 +17,8 @@ getAlbumR albumId = do
return (userId == ownerId) return (userId == ownerId)
Nothing -> Nothing ->
return False 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 defaultLayout $ do
$(widgetFile "album") $(widgetFile "album")
Nothing -> do Nothing -> do

View file

@ -9,7 +9,8 @@ by <a href=@{ProfileR ownerId}>#{ownerName}</a>
This album is empty This album is empty
$else $else
Images in this album: Images in this album:
$forall (medium) <- media $forall (Entity mediumId medium) <- media
<div class="thumbnails"> <div class="thumbnails">
<a href=@{MediumR mediumId}>
<img src=#{mediumPath medium}><br> <img src=#{mediumPath medium}><br>
#{mediumTitle medium} #{mediumTitle medium}