UI: Browse: List project's enabled children

This commit is contained in:
Pere Lev 2024-04-10 17:27:19 +03:00
parent 24aba4d370
commit 0b08a7692a
No known key found for this signature in database
GPG key ID: 5252C5C863E5E57D
2 changed files with 36 additions and 6 deletions

View file

@ -409,7 +409,28 @@ getBrowseR = do
return (inztance, remoteObject, remoteActor)
)
byKeyOrRaid
return (j, jactor, cs')
children <- E.select $ E.from $ \ (deleg `E.InnerJoin` holder) -> do
E.on $ deleg E.^. SourceUsSendDelegatorSource E.==. holder E.^. SourceHolderProjectSource
E.where_ $ holder E.^. SourceHolderProjectProject E.==. E.val projectID
return $ holder E.^. SourceHolderProjectSource
children' <- for children $ \ (E.Value sourceID) -> do
byKeyOrRaid <- bimap snd snd <$> getSourceTopic sourceID
bitraverse
(\case
Right _g -> error "I'm a project and I have a parent who is a local Group"
Left j -> do
actorID <- projectActor <$> getJust j
actor <- getJust actorID
return (j, actor)
)
(\ remoteActorID -> do
remoteActor <- getJust remoteActorID
remoteObject <- getJust $ remoteActorIdent remoteActor
inztance <- getJust $ remoteObjectInstance remoteObject
return (inztance, remoteObject, remoteActor)
)
byKeyOrRaid
return (j, jactor, cs', children')
)
{-
now <- liftIO getCurrentTime

View file

@ -1,6 +1,6 @@
$# This file is part of Vervis.
$#
$# Written in 2016, 2018, 2019, 2022, 2023
$# Written in 2016, 2018, 2019, 2022, 2023, 2024
$# by fr33domlover <fr33domlover@riseup.net>.
$#
$# ♡ Copying is an act of love. Please copy, reuse and share.
@ -101,11 +101,20 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
<h2>Projects
<ul>
$forall (Entity projectID _, Entity _ actor, components) <- projects
$forall (Entity projectID _, Entity _ actor, components, children) <- projects
<li>
<a href=@{ProjectR $ hashProject projectID}>
\$#{keyHashidText $ hashProject projectID} #{actorName actor}
<ul>
$forall c <- components
<li>
^{componentLinkFedW c}
$if not $ null components
<li>Components
<ul>
$forall c <- components
<li>
^{componentLinkFedW c}
$if not $ null children
<li>Children
<ul>
$forall c <- children
<li>
^{projectLinkFedW c}