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
|
||||
|
||||
getProfileR :: UserId -> Handler Html
|
||||
getProfileR user = do
|
||||
owner <- runDB $ get user
|
||||
getProfileR ownerId = do
|
||||
owner <- runDB $ get ownerId
|
||||
ownerName <- lift $ pure $ userName $ fromJust owner
|
||||
userAlbs <- runDB $ selectList [AlbumOwner ==. user] [Desc AlbumTitle]
|
||||
recentMedia <- (runDB $ selectList [MediumOwner ==. user] [Desc MediumTime])
|
||||
userAlbs <- runDB $ selectList [AlbumOwner ==. ownerId] [Desc AlbumTitle]
|
||||
recentMedia <- (runDB $ selectList [MediumOwner ==. ownerId] [Desc MediumTime])
|
||||
msu <- lookupSession "userId"
|
||||
case msu of
|
||||
presence <- case msu of
|
||||
Just tempUserId -> do
|
||||
userId <- lift $ pure $ getUserIdFromText tempUserId
|
||||
presence <- lift $ pure $ userId == user
|
||||
defaultLayout $ do
|
||||
$(widgetFile "profile")
|
||||
return (userId == ownerId)
|
||||
Nothing ->
|
||||
defaultLayout $ do
|
||||
$(widgetFile "profile")
|
||||
return False
|
||||
defaultLayout $ do
|
||||
$(widgetFile "profile")
|
||||
|
|
|
@ -7,7 +7,7 @@ $else
|
|||
Albums of this user:
|
||||
$forall (Entity albumId album) <- userAlbs
|
||||
<div class="thumbnails">
|
||||
<a href=@{AlbumR user albumId}>
|
||||
<a href=@{AlbumR ownerId albumId}>
|
||||
<img width="200px" src="/static/img/album.jpg"><br>
|
||||
#{albumTitle album}
|
||||
|
||||
|
|
Loading…
Reference in a new issue