changed confusing nomenclature

This commit is contained in:
nek0 2014-08-18 03:10:33 +02:00
parent cc6d60e08d
commit b718e0ba08
2 changed files with 10 additions and 11 deletions

View file

@ -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 ->
return False
defaultLayout $ do
$(widgetFile "profile")

View file

@ -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}