profilesite working
This commit is contained in:
parent
e11dc798a5
commit
2c99c0fe6b
3 changed files with 9 additions and 3 deletions
|
@ -7,7 +7,7 @@ getProfileR :: UserId -> Handler Html
|
||||||
getProfileR user = do
|
getProfileR user = do
|
||||||
owner <- runDB $ get user
|
owner <- runDB $ get user
|
||||||
ownerName <- lift $ pure $ userName $ fromJust owner
|
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])
|
recentMedia <- (runDB $ selectList [MediumOwner ==. user] [Desc MediumTime])
|
||||||
msu <- lookupSession "userId"
|
msu <- lookupSession "userId"
|
||||||
case msu of
|
case msu of
|
||||||
|
@ -16,3 +16,6 @@ getProfileR user = do
|
||||||
presence <- lift $ pure $ userId == user
|
presence <- lift $ pure $ userId == user
|
||||||
defaultLayout $ do
|
defaultLayout $ do
|
||||||
$(widgetFile "profile")
|
$(widgetFile "profile")
|
||||||
|
Nothing ->
|
||||||
|
defaultLayout $ do
|
||||||
|
$(widgetFile "profile")
|
||||||
|
|
BIN
static/img/album.jpg
Normal file
BIN
static/img/album.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 774 KiB |
|
@ -1,12 +1,15 @@
|
||||||
$newline always
|
$newline always
|
||||||
<h3>Profile of #{ownerName}
|
<h3>Profile of #{ownerName}
|
||||||
|
|
||||||
$if null userAlbums
|
$if null userAlbs
|
||||||
This user has no albums yet
|
This user has no albums yet
|
||||||
$else
|
$else
|
||||||
Albums of this user:
|
Albums of this user:
|
||||||
$forall (Entity albumId album) <- userAlbums
|
$forall (Entity albumId album) <- userAlbs
|
||||||
<div class="thumbnails">
|
<div class="thumbnails">
|
||||||
|
<a href=@{AlbumR user albumId}>
|
||||||
|
<img width="200px" src="/static/img/album.jpg"><br>
|
||||||
|
#{albumTitle album}
|
||||||
|
|
||||||
$if null recentMedia
|
$if null recentMedia
|
||||||
This user has not uploaded any images
|
This user has not uploaded any images
|
||||||
|
|
Loading…
Reference in a new issue