diff --git a/src/Vervis/Handler/Cloth.hs b/src/Vervis/Handler/Cloth.hs index ce658aa..3d78ce8 100644 --- a/src/Vervis/Handler/Cloth.hs +++ b/src/Vervis/Handler/Cloth.hs @@ -265,10 +265,10 @@ getClothR loomHash clothHash = do where getClothHtml = do mpid <- maybeAuthId - (ticket, targetRepo, author, tparams, eparams, cparams, moriginRepo) <- handlerToWidget $ runDB $ do + (ticket, targetRepo, author, tparams, eparams, cparams, moriginRepo, mbundle) <- handlerToWidget $ runDB $ do (Entity _ loom, Entity _ cloth, Entity ticketID ticket, author, _maybe_ResolveAndEitherTrlOrTrr, proposal) <- getCloth404 loomHash clothHash - (ticket,,,,,,) + (ticket,,,,,,,) <$> getLocalRepo (loomRepo loom) (ticketLoomBranch cloth) <*> bitraverse (\ (Entity _ (TicketAuthorLocal _ personID _)) -> do @@ -295,6 +295,14 @@ getClothR loomHash clothHash = do ) ) (justThere proposal) + <*> traverse + (\ (bundleID :| _) -> do + ids <- selectKeysList [PatchBundle ==. bundleID] [Desc PatchId] + case nonEmpty ids of + Nothing -> error "Bundle without any Patches in DB" + Just ne -> return (bundleID, ne) + ) + (justHere proposal) hashMessageKey <- handlerToWidget getEncodeKeyHashid let desc :: Widget desc = toWidget $ preEscapedToMarkup $ ticketDescription ticket @@ -316,6 +324,8 @@ getClothR loomHash clothHash = do (ClothFollowR loomHash clothHash) (ClothUnfollowR loomHash clothHash) (ticketFollowers ticket) + hashBundle <- handlerToWidget getEncodeKeyHashid + hashPatch <- handlerToWidget getEncodeKeyHashid $(widgetFile "cloth/one") where getLocalRepo repoID mbranch = do diff --git a/templates/bundle.hamlet b/templates/bundle.hamlet index be75730..a052571 100644 --- a/templates/bundle.hamlet +++ b/templates/bundle.hamlet @@ -22,11 +22,14 @@ $nothing Older versions, last to first: