Only show the Compare button when it'll work

On the branch page.
This commit is contained in:
Christopher Baines 2019-08-05 21:24:07 +01:00
parent 9e80bda4f9
commit 82c3e8942b

View file

@ -799,7 +799,8 @@
(tbody (tbody
,@(map ,@(map
(match-lambda* (match-lambda*
(((commit date revision-exists? job-events) previous-commit) (((commit date revision-exists? job-events)
(previous-commit previous-revision-exists?))
`(tr `(tr
(td ,date) (td ,date)
(td ,@(if (string=? commit "NULL") (td ,@(if (string=? commit "NULL")
@ -819,7 +820,9 @@
(else (else
'(span (@ (class "label label-default")) '(span (@ (class "label label-default"))
"No information yet")))))) "No information yet"))))))
,@(if previous-commit ,@(if (and previous-commit
revision-exists?
previous-revision-exists?)
`((td `((td
(@ (style "vertical-align: middle;") (@ (style "vertical-align: middle;")
(rowspan "2")) (rowspan "2"))
@ -835,8 +838,12 @@
"⇕ Compare")))) "⇕ Compare"))))
'())))) '()))))
branch-commits branch-commits
(append (map first (cdr branch-commits)) (append (map (match-lambda
(list #f))))))))))) ((commit date revision-exists? job-events)
(list commit
revision-exists?)))
(cdr branch-commits))
'((#f #f))))))))))))
(define (view-builds stats builds) (define (view-builds stats builds)