From ffe68390e5f13d17ee1b16fb020ce1b307d67ba8 Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Mon, 19 Sep 2022 11:40:08 +0000 Subject: [PATCH] UI: getBundleR: Display list of old versions and list of patches --- src/Vervis/Handler/Cloth.hs | 11 +++-------- templates/bundle.hamlet | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 templates/bundle.hamlet diff --git a/src/Vervis/Handler/Cloth.hs b/src/Vervis/Handler/Cloth.hs index 3d9df7b..ce658aa 100644 --- a/src/Vervis/Handler/Cloth.hs +++ b/src/Vervis/Handler/Cloth.hs @@ -422,6 +422,7 @@ getBundleR loomHash clothHash bundleHash = do hashPatch <- getEncodeKeyHashid let versionRoute = BundleR loomHash clothHash . hashBundle + patchRoute = PatchR loomHash clothHash bundleHash . hashPatch bundleLocalAP = AP.BundleLocal { AP.bundleId = encodeRouteLocal here , AP.bundleContext = @@ -434,15 +435,9 @@ getBundleR loomHash clothHash bundleHash = do bundleAP = AP.BundleHosted (Just bundleLocalAP) - (NE.map - ( encodeRouteLocal - . PatchR loomHash clothHash bundleHash - . hashPatch - ) - patchIDs - ) + (NE.map (encodeRouteLocal . patchRoute) patchIDs) - provideHtmlAndAP bundleAP $ redirectToPrettyJSON here + provideHtmlAndAP bundleAP $(widgetFile "bundle") where here = BundleR loomHash clothHash bundleHash diff --git a/templates/bundle.hamlet b/templates/bundle.hamlet new file mode 100644 index 0000000..be75730 --- /dev/null +++ b/templates/bundle.hamlet @@ -0,0 +1,32 @@ +$# This file is part of Vervis. +$# +$# Written in 2022 by fr33domlover . +$# +$# ♡ Copying is an act of love. Please copy, reuse and share. +$# +$# The author(s) have dedicated all copyright and related and neighboring +$# rights to this software to the public domain worldwide. This software is +$# distributed without any warranty. +$# +$# You should have received a copy of the CC0 Public Domain Dedication along +$# with this software. If not, see +$# . + +$maybe bundleID <- maybeCurrentBundle +
+ [NOTE] This bundle is outdated, see + + latest version +$nothing +
+ Older versions, last to first: +