From 82c3e8942bc24adf1658dfcd058e07f4f5a1d67d Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 5 Aug 2019 21:24:07 +0100 Subject: Only show the Compare button when it'll work On the branch page. --- guix-data-service/web/view/html.scm | 15 +++++++++++---- 1 file 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) -- cgit v1.2.3