aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-11-14 21:19:38 +0000
committerChristopher Baines <mail@cbaines.net>2019-11-14 21:19:38 +0000
commit80cd33e07d72da1d0cd3cbf1c8b9934c4472a2ed (patch)
treef0153c280246b43a4c9a638d995174640e5cad09
parenteaf3708e2adf1270f3623313a97b83cab4b6b216 (diff)
downloaddata-service-80cd33e07d72da1d0cd3cbf1c8b9934c4472a2ed.tar
data-service-80cd33e07d72da1d0cd3cbf1c8b9934c4472a2ed.tar.gz
Add a generic way of presenting values that may be store items
-rw-r--r--guix-data-service/web/view/html.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm
index 93d44a9..560505a 100644
--- a/guix-data-service/web/view/html.scm
+++ b/guix-data-service/web/view/html.scm
@@ -32,6 +32,7 @@
header
form-horizontal-control
+ display-possible-store-item
display-store-item
display-store-item-short
build-status-span
@@ -426,6 +427,18 @@
(style "display: inline-block; font-size: 1.2em; margin-top: 0.4em;"))
,(build-status-value->display-string status)))
+(define (display-possible-store-item value)
+ (match (string-split value #\/)
+ (("" "gnu" "store" item)
+ `(a (@ (href ,value))
+ ,(display-store-item value)))
+ (("" "gnu" "store" item fileparts ...)
+ `(a (@ (href ,value))
+ ,(display-file-in-store-item-oneline value)))
+ (_
+ `(span (@ (style "font-family: monospace;"))
+ ,value))))
+
(define (display-store-item-short item)
`((span (@ (style "font-size: small; font-family: monospace; display: block;"))
,(string-take item 44))