UI: Personal overview: List your repos, decks, looms

This commit is contained in:
fr33domlover 2022-09-27 08:04:55 +00:00
parent 5a2cc84bdc
commit ceb0d951c1
3 changed files with 65 additions and 6 deletions

View file

@ -146,10 +146,39 @@ getHomeR = do
Nothing -> redirect BrowseR
where
personalOverview :: Entity Person -> Handler Html
personalOverview (Entity _pid _person) =
defaultLayout $ do
setTitle "Vervis > Overview"
$(widgetFile "personal-overview")
personalOverview (Entity pid _person) = do
(repos, decks, looms) <- runDB $ (,,)
<$> (E.select $ E.from $ \ (recip `E.InnerJoin` collab `E.InnerJoin` enable `E.InnerJoin` repo `E.InnerJoin` actor) -> do
E.on $ repo E.^. RepoActor E.==. actor E.^. ActorId
E.on $ collab E.^. CollabTopicRepoRepo E.==. repo E.^. RepoId
E.on $ collab E.^. CollabTopicRepoCollab E.==. enable E.^. CollabEnableCollab
E.on $ recip E.^. CollabRecipLocalCollab E.==. collab E.^. CollabTopicRepoCollab
E.where_ $ recip E.^. CollabRecipLocalPerson E.==. E.val pid
E.orderBy [E.asc $ repo E.^. RepoId]
return (repo, actor)
)
<*> (E.select $ E.from $ \ (recip `E.InnerJoin` collab `E.InnerJoin` enable `E.InnerJoin` deck `E.InnerJoin` actor) -> do
E.on $ deck E.^. DeckActor E.==. actor E.^. ActorId
E.on $ collab E.^. CollabTopicDeckDeck E.==. deck E.^. DeckId
E.on $ collab E.^. CollabTopicDeckCollab E.==. enable E.^. CollabEnableCollab
E.on $ recip E.^. CollabRecipLocalCollab E.==. collab E.^. CollabTopicDeckCollab
E.where_ $ recip E.^. CollabRecipLocalPerson E.==. E.val pid
E.orderBy [E.asc $ deck E.^. DeckId]
return (deck, actor)
)
<*> (E.select $ E.from $ \ (recip `E.InnerJoin` collab `E.InnerJoin` enable `E.InnerJoin` loom `E.InnerJoin` actor) -> do
E.on $ loom E.^. LoomActor E.==. actor E.^. ActorId
E.on $ collab E.^. CollabTopicLoomLoom E.==. loom E.^. LoomId
E.on $ collab E.^. CollabTopicLoomCollab E.==. enable E.^. CollabEnableCollab
E.on $ recip E.^. CollabRecipLocalCollab E.==. collab E.^. CollabTopicLoomCollab
E.where_ $ recip E.^. CollabRecipLocalPerson E.==. E.val pid
E.orderBy [E.asc $ loom E.^. LoomId]
return (loom, actor)
)
hashRepo <- getEncodeKeyHashid
hashDeck <- getEncodeKeyHashid
hashLoom <- getEncodeKeyHashid
defaultLayout $(widgetFile "personal-overview")
getBrowseR :: Handler Html
getBrowseR = do

View file

@ -17,6 +17,8 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
personal overview here. Your projects, repos, news, notifications, settings
and so on.
<h2>Actions
<ul>
<li>
<a href=@{KeysR}>
@ -36,3 +38,31 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
<li>
<a href=@{PublishMergeR}>
Merge a merge request
<h2>Your teams
<p>You aren't a member of any teams at the moment.
<h2>Your repos
<ul>
$forall (Entity repoID _, Entity _ actor) <- repos
<li>
<a href=@{RepoR $ hashRepo repoID}>
^#{keyHashidText $ hashRepo repoID} #{actorName actor}
<h2>Your ticket trackers
<ul>
$forall (Entity deckID _, Entity _ actor) <- decks
<li>
<a href=@{DeckR $ hashDeck deckID}>
=#{keyHashidText $ hashDeck deckID} #{actorName actor}
<h2>Your patch trackers
<ul>
$forall (Entity loomID _, Entity _ actor) <- looms
<li>
<a href=@{LoomR $ hashLoom loomID}>
+#{keyHashidText $ hashLoom loomID} #{actorName actor}

View file

@ -1,6 +1,6 @@
$# This file is part of Vervis.
$#
$# Written in 2016, 2018 by fr33domlover <fr33domlover@riseup.net>.
$# Written in 2016, 2018, 2022 by fr33domlover <fr33domlover@riseup.net>.
$#
$# ♡ Copying is an act of love. Please copy, reuse and share.
$#
@ -15,6 +15,6 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
<span .parents>
$forall (route, title) <- bcs
<a href=@{route}>#{title}
#
» #
<span .title>
#{current}