From 80a08dea0a181e04ebd29f47f1092d5070da0edd Mon Sep 17 00:00:00 2001 From: Pere Lev Date: Tue, 21 Nov 2023 10:56:09 +0200 Subject: [PATCH] UI: Browse: Update intro text & list projects' components --- src/Vervis/Handler/Client.hs | 40 ++++++++++++++++++++++++++++++++---- templates/browse.hamlet | 38 +++++++++++++++++++--------------- 2 files changed, 57 insertions(+), 21 deletions(-) diff --git a/src/Vervis/Handler/Client.hs b/src/Vervis/Handler/Client.hs index 02070a0..492da48 100644 --- a/src/Vervis/Handler/Client.hs +++ b/src/Vervis/Handler/Client.hs @@ -51,6 +51,8 @@ import Control.Applicative import Control.Concurrent.STM.TVar import Control.Monad import Control.Monad.Trans.Except +import Data.Bifunctor +import Data.Bitraversable import Data.List import Data.Text (Text) import Data.Time.Clock @@ -90,14 +92,17 @@ import Yesod.Form.Local import Vervis.API import Vervis.Client import Vervis.Data.Actor +import Vervis.Data.Collab import Vervis.FedURI import Vervis.Form.Ticket import Vervis.Foundation import Vervis.Model import Vervis.Model.Ident +import Vervis.Persist.Collab import Vervis.Recipient import Vervis.Settings import Vervis.Web.Actor +import Vervis.Widget.Tracker -- | Account verification email resend form getResendVerifyEmailR :: Handler Html @@ -201,10 +206,37 @@ getBrowseR = do E.orderBy [E.asc $ loom E.^. LoomId] return (loom, actor) ) - <*> (E.select $ E.from $ \ (project `E.InnerJoin` actor) -> do - E.on $ project E.^. ProjectActor E.==. actor E.^. ActorId - E.orderBy [E.asc $ project E.^. ProjectId] - return (project, actor) + <*> (do js <- + E.select $ E.from $ \ (project `E.InnerJoin` actor) -> do + E.on $ project E.^. ProjectActor E.==. actor E.^. ActorId + E.orderBy [E.asc $ project E.^. ProjectId] + return (project, actor) + for js $ \ (j@(Entity projectID _), jactor) -> do + cs <- + E.select $ E.from $ \ (comp `E.InnerJoin` enable) -> do + E.on $ comp E.^. ComponentId E.==. enable E.^. ComponentEnableComponent + E.where_ $ comp E.^. ComponentProject E.==. E.val projectID + return comp + cs' <- for cs $ \ (Entity cid _) -> do + byKeyOrRaid <- bimap snd snd <$> getComponentIdent cid + bitraverse + (\ byKey -> do + actorID <- + case byKey of + ComponentRepo k -> repoActor <$> getJust k + ComponentDeck k -> deckActor <$> getJust k + ComponentLoom k -> loomActor <$> getJust k + actor <- getJust actorID + return (byKey, actor) + ) + (\ remoteActorID -> do + remoteActor <- getJust remoteActorID + remoteObject <- getJust $ remoteActorIdent remoteActor + inztance <- getJust $ remoteObjectInstance remoteObject + return (inztance, remoteObject, remoteActor) + ) + byKeyOrRaid + return (j, jactor, cs') ) {- now <- liftIO getCurrentTime diff --git a/templates/browse.hamlet b/templates/browse.hamlet index 09e8b30..bb9ca14 100644 --- a/templates/browse.hamlet +++ b/templates/browse.hamlet @@ -17,15 +17,14 @@ $# . Vervis is a work-in-progress federated project and repository hosting and collaboration platform. Its development is meant to help form the ForgeFed specification for project hosting platform federation, and hopefully get - existing platforms (such as Gitea, Gogs, GitLab CE, etc.) to support it. + existing platforms (such as Forgejo, Gitea, GitLab CE, etc.) to support it.

- Vervis is being used for its own development: - - Vervis project page - -

- Vervis is a Peers community project. + Help wanted! Vervis is meant to be just a backend. We're looking for + developers to work on the + + Anvil + frontend.

Vervis is a web application written in the Haskell programming language and @@ -41,22 +40,23 @@ $# .