diff --git a/Handler/Profile.hs b/Handler/Profile.hs index 18b27de..2877642 100644 --- a/Handler/Profile.hs +++ b/Handler/Profile.hs @@ -7,7 +7,7 @@ getProfileR :: UserId -> Handler Html getProfileR user = do owner <- runDB $ get user ownerName <- lift $ pure $ userName $ fromJust owner - userAlbums <- runDB $ selectList [AlbumOwner ==. user] [Desc AlbumTitle] + userAlbs <- runDB $ selectList [AlbumOwner ==. user] [Desc AlbumTitle] recentMedia <- (runDB $ selectList [MediumOwner ==. user] [Desc MediumTime]) msu <- lookupSession "userId" case msu of @@ -16,3 +16,6 @@ getProfileR user = do presence <- lift $ pure $ userId == user defaultLayout $ do $(widgetFile "profile") + Nothing -> + defaultLayout $ do + $(widgetFile "profile") diff --git a/static/img/album.jpg b/static/img/album.jpg new file mode 100644 index 0000000..20eb036 Binary files /dev/null and b/static/img/album.jpg differ diff --git a/templates/profile.hamlet b/templates/profile.hamlet index ff7953c..0d872f1 100644 --- a/templates/profile.hamlet +++ b/templates/profile.hamlet @@ -1,12 +1,15 @@ $newline always

Profile of #{ownerName} -$if null userAlbums +$if null userAlbs This user has no albums yet $else Albums of this user: - $forall (Entity albumId album) <- userAlbums + $forall (Entity albumId album) <- userAlbs
+ +
+ #{albumTitle album} $if null recentMedia This user has not uploaded any images