diff --git a/src/Vervis/Handler/Cloth.hs b/src/Vervis/Handler/Cloth.hs index 621168a..4bede0f 100644 --- a/src/Vervis/Handler/Cloth.hs +++ b/src/Vervis/Handler/Cloth.hs @@ -317,8 +317,11 @@ getClothR loomHash clothHash = do let patchIDs = NE.map entityKey patches diffs = NE.map (patchContent . entityVal) $ NE.reverse patches (repoID, _, _, maybeBranch) = targetRepo - errorOrCanApply <- runExceptT $ canApplyPatches repoID maybeBranch diffs - return (bundleID, patchIDs, errorOrCanApply) + maybeErrorOrCanApply <- + case ticketStatus ticket of + TSClosed -> pure Nothing + _ -> Just <$> runExceptT (canApplyPatches repoID maybeBranch diffs) + return (bundleID, patchIDs, maybeErrorOrCanApply) hashMessageKey <- handlerToWidget getEncodeKeyHashid let desc :: Widget desc = toWidget $ markupHTML $ ticketDescription ticket diff --git a/templates/cloth/one.hamlet b/templates/cloth/one.hamlet index bfb088e..65f368c 100644 --- a/templates/cloth/one.hamlet +++ b/templates/cloth/one.hamlet @@ -54,7 +54,7 @@ $with (_repoID, repoHash, name, maybeBranch) <- targetRepo #{branch} -$maybe (bundleID, patchIDs, errorOrCanApply) <- mbundle' +$maybe (bundleID, patchIDs, maybeErrorOrCanApply) <- mbundle'
Bundle @@ -66,20 +66,23 @@ $maybe (bundleID, patchIDs, errorOrCanApply) <- mbundle' #{keyHashidText $ hashPatch patchID}
- Status: - $case errorOrCanApply - $of Left e - - [Error! #{e}] - ^{applyButton "Try applying anyway"} - $of Right False - - [Apply check failed! Possibly conflicts exist] - ^{applyButton "Try applying anyway"} - $of Right True - - [Can apply!] - ^{applyButton "Apply"} + Status: # + $maybe errorOrCanApply <- maybeErrorOrCanApply + $case errorOrCanApply + $of Left e + + [Error! #{e}] + ^{applyButton "Try applying anyway"} + $of Right False + + [Apply check failed! Possibly conflicts exist] + ^{applyButton "Try applying anyway"} + $of Right True + + [Can apply!] + ^{applyButton "Apply"} + $nothing + RESOLVED