mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-27 17:54:53 +09:00
UI: Personal overview: List your repos, decks, looms
This commit is contained in:
parent
5a2cc84bdc
commit
ceb0d951c1
3 changed files with 65 additions and 6 deletions
|
@ -146,10 +146,39 @@ getHomeR = do
|
||||||
Nothing -> redirect BrowseR
|
Nothing -> redirect BrowseR
|
||||||
where
|
where
|
||||||
personalOverview :: Entity Person -> Handler Html
|
personalOverview :: Entity Person -> Handler Html
|
||||||
personalOverview (Entity _pid _person) =
|
personalOverview (Entity pid _person) = do
|
||||||
defaultLayout $ do
|
(repos, decks, looms) <- runDB $ (,,)
|
||||||
setTitle "Vervis > Overview"
|
<$> (E.select $ E.from $ \ (recip `E.InnerJoin` collab `E.InnerJoin` enable `E.InnerJoin` repo `E.InnerJoin` actor) -> do
|
||||||
$(widgetFile "personal-overview")
|
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 :: Handler Html
|
||||||
getBrowseR = do
|
getBrowseR = do
|
||||||
|
|
|
@ -17,6 +17,8 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||||
personal overview here. Your projects, repos, news, notifications, settings
|
personal overview here. Your projects, repos, news, notifications, settings
|
||||||
and so on.
|
and so on.
|
||||||
|
|
||||||
|
<h2>Actions
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href=@{KeysR}>
|
<a href=@{KeysR}>
|
||||||
|
@ -36,3 +38,31 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||||
<li>
|
<li>
|
||||||
<a href=@{PublishMergeR}>
|
<a href=@{PublishMergeR}>
|
||||||
Merge a merge request
|
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}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
$# This file is part of Vervis.
|
$# 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.
|
$# ♡ Copying is an act of love. Please copy, reuse and share.
|
||||||
$#
|
$#
|
||||||
|
@ -15,6 +15,6 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||||
<span .parents>
|
<span .parents>
|
||||||
$forall (route, title) <- bcs
|
$forall (route, title) <- bcs
|
||||||
<a href=@{route}>#{title}
|
<a href=@{route}>#{title}
|
||||||
→ #
|
» #
|
||||||
<span .title>
|
<span .title>
|
||||||
#{current}
|
#{current}
|
||||||
|
|
Loading…
Reference in a new issue