UI: getBundleR: Display list of old versions and list of patches
This commit is contained in:
parent
dae8554a12
commit
ffe68390e5
2 changed files with 35 additions and 8 deletions
|
@ -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
|
||||
|
||||
|
|
32
templates/bundle.hamlet
Normal file
32
templates/bundle.hamlet
Normal 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}
|
Loading…
Reference in a new issue