changed confusing nomenclature
This commit is contained in:
parent
cc6d60e08d
commit
b718e0ba08
2 changed files with 10 additions and 11 deletions
|
@ -4,18 +4,17 @@ import Import
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
|
|
||||||
getProfileR :: UserId -> Handler Html
|
getProfileR :: UserId -> Handler Html
|
||||||
getProfileR user = do
|
getProfileR ownerId = do
|
||||||
owner <- runDB $ get user
|
owner <- runDB $ get ownerId
|
||||||
ownerName <- lift $ pure $ userName $ fromJust owner
|
ownerName <- lift $ pure $ userName $ fromJust owner
|
||||||
userAlbs <- runDB $ selectList [AlbumOwner ==. user] [Desc AlbumTitle]
|
userAlbs <- runDB $ selectList [AlbumOwner ==. ownerId] [Desc AlbumTitle]
|
||||||
recentMedia <- (runDB $ selectList [MediumOwner ==. user] [Desc MediumTime])
|
recentMedia <- (runDB $ selectList [MediumOwner ==. ownerId] [Desc MediumTime])
|
||||||
msu <- lookupSession "userId"
|
msu <- lookupSession "userId"
|
||||||
case msu of
|
presence <- case msu of
|
||||||
Just tempUserId -> do
|
Just tempUserId -> do
|
||||||
userId <- lift $ pure $ getUserIdFromText tempUserId
|
userId <- lift $ pure $ getUserIdFromText tempUserId
|
||||||
presence <- lift $ pure $ userId == user
|
return (userId == ownerId)
|
||||||
defaultLayout $ do
|
|
||||||
$(widgetFile "profile")
|
|
||||||
Nothing ->
|
Nothing ->
|
||||||
defaultLayout $ do
|
return False
|
||||||
$(widgetFile "profile")
|
defaultLayout $ do
|
||||||
|
$(widgetFile "profile")
|
||||||
|
|
|
@ -7,7 +7,7 @@ $else
|
||||||
Albums of this user:
|
Albums of this user:
|
||||||
$forall (Entity albumId album) <- userAlbs
|
$forall (Entity albumId album) <- userAlbs
|
||||||
<div class="thumbnails">
|
<div class="thumbnails">
|
||||||
<a href=@{AlbumR user albumId}>
|
<a href=@{AlbumR ownerId albumId}>
|
||||||
<img width="200px" src="/static/img/album.jpg"><br>
|
<img width="200px" src="/static/img/album.jpg"><br>
|
||||||
#{albumTitle album}
|
#{albumTitle album}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue