diff --git a/src/Vervis/Handler/Client.hs b/src/Vervis/Handler/Client.hs
index 236ce2f..ec1f5c4 100644
--- a/src/Vervis/Handler/Client.hs
+++ b/src/Vervis/Handler/Client.hs
@@ -374,24 +374,34 @@ postPublishR = do
getBrowseR :: Handler Html
getBrowseR = do
- rows <- do
- repos <- runDB $ E.select $ E.from $
- \ (repo `E.LeftOuterJoin` project `E.InnerJoin` sharer) -> do
- E.on $ repo E.^. RepoSharer E.==. sharer E.^. SharerId
- E.on $ repo E.^. RepoProject E.==. project E.?. ProjectId
- E.orderBy
- [ E.asc $ sharer E.^. SharerIdent
- , E.asc $ project E.?. ProjectIdent
- , E.asc $ repo E.^. RepoIdent
- ]
+ (rowsRepo, rowsProject) <- do
+ (repos, projects) <- runDB $ do
+ rs <- E.select $ E.from $
+ \ (repo `E.LeftOuterJoin` project `E.InnerJoin` sharer) -> do
+ E.on $ repo E.^. RepoSharer E.==. sharer E.^. SharerId
+ E.on $ repo E.^. RepoProject E.==. project E.?. ProjectId
+ E.orderBy
+ [ E.asc $ sharer E.^. SharerIdent
+ , E.asc $ project E.?. ProjectIdent
+ , E.asc $ repo E.^. RepoIdent
+ ]
+ return
+ ( sharer E.^. SharerIdent
+ , project E.?. ProjectIdent
+ , repo E.^. RepoIdent
+ , repo E.^. RepoVcs
+ )
+ js <- E.select $ E.from $ \ (j `E.InnerJoin` s `E.LeftOuterJoin` r) -> do
+ E.on $ E.just (j E.^. ProjectId) E.==. E.joinV (r E.?. RepoProject)
+ E.on $ j E.^. ProjectSharer E.==. s E.^. SharerId
+ E.where_ $ E.isNothing $ r E.?. RepoId
return
- ( sharer E.^. SharerIdent
- , project E.?. ProjectIdent
- , repo E.^. RepoIdent
- , repo E.^. RepoVcs
+ ( s E.^. SharerIdent
+ , j E.^. ProjectIdent
)
+ return (rs, js)
now <- liftIO getCurrentTime
- forM repos $
+ repoRows <- forM repos $
\ (E.Value sharer, E.Value mproj, E.Value repo, E.Value vcs) -> do
path <- askRepoDir sharer repo
mlast <- case vcs of
@@ -405,6 +415,7 @@ getBrowseR = do
FriendlyConvert $
now `diffUTCTime` t
return (sharer, mproj, repo, vcs, mlast)
+ return (repoRows, projects)
defaultLayout $ do
setTitle "Welcome to Vervis!"
$(widgetFile "homepage")
diff --git a/templates/homepage.hamlet b/templates/homepage.hamlet
index 1a316b2..811dfc7 100644
--- a/templates/homepage.hamlet
+++ b/templates/homepage.hamlet
@@ -63,7 +63,7 @@ $#
Sharer + | Project + $forall (E.Value sharer, E.Value project) <- rowsProject + |
---|---|
+ #{shr2text sharer} + |
+ #{prj2text project}
+
People
|