aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-08-05 21:24:07 +0100
committerChristopher Baines <mail@cbaines.net>2019-08-05 21:24:07 +0100
commit82c3e8942bc24adf1658dfcd058e07f4f5a1d67d (patch)
treeeba5ad483e302c070ca00bb1f0477c65e2edaeaa /guix-data-service
parent9e80bda4f91e06e3e1d60cf48d33534b7cabb626 (diff)
downloaddata-service-82c3e8942bc24adf1658dfcd058e07f4f5a1d67d.tar
data-service-82c3e8942bc24adf1658dfcd058e07f4f5a1d67d.tar.gz
Only show the Compare button when it'll work
On the branch page.
Diffstat (limited to 'guix-data-service')
-rw-r--r--guix-data-service/web/view/html.scm15
1 files changed, 11 insertions, 4 deletions
diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm
index 647a07e..ee37f07 100644
--- a/guix-data-service/web/view/html.scm
+++ b/guix-data-service/web/view/html.scm
@@ -799,7 +799,8 @@
(tbody
,@(map
(match-lambda*
- (((commit date revision-exists? job-events) previous-commit)
+ (((commit date revision-exists? job-events)
+ (previous-commit previous-revision-exists?))
`(tr
(td ,date)
(td ,@(if (string=? commit "NULL")
@@ -819,7 +820,9 @@
(else
'(span (@ (class "label label-default"))
"No information yet"))))))
- ,@(if previous-commit
+ ,@(if (and previous-commit
+ revision-exists?
+ previous-revision-exists?)
`((td
(@ (style "vertical-align: middle;")
(rowspan "2"))
@@ -835,8 +838,12 @@
"⇕ Compare"))))
'()))))
branch-commits
- (append (map first (cdr branch-commits))
- (list #f)))))))))))
+ (append (map (match-lambda
+ ((commit date revision-exists? job-events)
+ (list commit
+ revision-exists?)))
+ (cdr branch-commits))
+ '((#f #f))))))))))))
(define (view-builds stats builds)