UI: getBundleR: Display list of old versions and list of patches

This commit is contained in:
fr33domlover 2022-09-19 11:40:08 +00:00
parent dae8554a12
commit ffe68390e5
2 changed files with 35 additions and 8 deletions

View file

@ -422,6 +422,7 @@ getBundleR loomHash clothHash bundleHash = do
hashPatch <- getEncodeKeyHashid hashPatch <- getEncodeKeyHashid
let versionRoute = BundleR loomHash clothHash . hashBundle let versionRoute = BundleR loomHash clothHash . hashBundle
patchRoute = PatchR loomHash clothHash bundleHash . hashPatch
bundleLocalAP = AP.BundleLocal bundleLocalAP = AP.BundleLocal
{ AP.bundleId = encodeRouteLocal here { AP.bundleId = encodeRouteLocal here
, AP.bundleContext = , AP.bundleContext =
@ -434,15 +435,9 @@ getBundleR loomHash clothHash bundleHash = do
bundleAP = bundleAP =
AP.BundleHosted AP.BundleHosted
(Just bundleLocalAP) (Just bundleLocalAP)
(NE.map (NE.map (encodeRouteLocal . patchRoute) patchIDs)
( encodeRouteLocal
. PatchR loomHash clothHash bundleHash
. hashPatch
)
patchIDs
)
provideHtmlAndAP bundleAP $ redirectToPrettyJSON here provideHtmlAndAP bundleAP $(widgetFile "bundle")
where where
here = BundleR loomHash clothHash bundleHash here = BundleR loomHash clothHash bundleHash

32
templates/bundle.hamlet Normal file
View file

@ -0,0 +1,32 @@
$# This file is part of Vervis.
$#
$# Written in 2022 by fr33domlover <fr33domlover@riseup.net>.
$#
$# ♡ 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
$# <http://creativecommons.org/publicdomain/zero/1.0/>.
$maybe bundleID <- maybeCurrentBundle
<div>
[NOTE] This bundle is outdated, see
<a href=@{versionRoute bundleID}>
latest version
$nothing
<div>
Older versions, last to first:
<ul>
$forall bundleID <- previousBundles
<a href=@{versionRoute bundleID}>
#{keyHashidText $ hashBundle bundleID}
<div>
Patches, last to first:
$forall patchID <- patchIDs
<a href=@{patchRoute patchID}>
#{keyHashidText $ hashPatch patchID}