UI: List projectless repos and "Create New" link in personal overview page

This commit is contained in:
fr33domlover 2019-10-17 11:45:06 +00:00
parent 02337c39e1
commit 271bc3dbd0
3 changed files with 20 additions and 5 deletions

View file

@ -83,12 +83,18 @@ intro = do
personalOverview :: Entity Person -> Handler Html personalOverview :: Entity Person -> Handler Html
personalOverview (Entity _pid person) = do personalOverview (Entity _pid person) = do
(ident, projects) <- runDB $ do (ident, projects, repos) <- runDB $ do
let sid = personIdent person let sid = personIdent person
sharer <- get404 sid sharer <- get404 sid
projs <- selectList [ProjectSharer ==. sid] [Asc ProjectIdent] prjs <-
let pi (Entity _ proj) = projectIdent proj map (projectIdent . entityVal) <$>
return (sharerIdent sharer, map pi projs) selectList [ProjectSharer ==. sid] [Asc ProjectIdent]
rps <-
map (repoIdent . entityVal) <$>
selectList
[RepoSharer ==. sid, RepoProject ==. Nothing]
[Asc RepoIdent]
return (sharerIdent sharer, prjs, rps)
defaultLayout $ do defaultLayout $ do
setTitle "Vervis > Overview" setTitle "Vervis > Overview"
$(widgetFile "personal-overview") $(widgetFile "personal-overview")

View file

@ -1,6 +1,6 @@
$# This file is part of Vervis. $# This file is part of Vervis.
$# $#
$# Written in 2016 by fr33domlover <fr33domlover@riseup.net>. $# Written in 2016, 2019 by fr33domlover <fr33domlover@riseup.net>.
$# $#
$# ♡ Copying is an act of love. Please copy, reuse and share. $# ♡ Copying is an act of love. Please copy, reuse and share.
$# $#

View file

@ -27,6 +27,15 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
<li> <li>
<a href=@{ProjectNewR ident}>Create new… <a href=@{ProjectNewR ident}>Create new…
<li>
<p>Standalone repos:
<ul>
$forall repo <- repos
<li>
<a href=@{RepoR ident repo}>#{rp2text repo}
<li>
<a href=@{RepoNewR ident}>Create new…
<li> <li>
<a href=@{SharerInboxR ident}>Inbox <a href=@{SharerInboxR ident}>Inbox