Add a utility to generate a span for the status of a build
This commit is contained in:
parent
0cebb97340
commit
9a99722643
1 changed files with 19 additions and 1 deletions
|
|
@ -20,7 +20,8 @@
|
|||
#:export (sexp-div
|
||||
|
||||
build-status-value->display-string
|
||||
build-status-span))
|
||||
build-status-span
|
||||
build-status-alist->build-icon))
|
||||
|
||||
(define (sexp-div sexp)
|
||||
(match sexp
|
||||
|
|
@ -64,3 +65,20 @@
|
|||
status)))
|
||||
(style "display: inline-block; font-size: 1.2em; margin-top: 0.4em;"))
|
||||
,(build-status-value->display-string status)))
|
||||
|
||||
(define (build-status-alist->build-icon status)
|
||||
`(span (@ (class ,(string-append
|
||||
"label label-"
|
||||
(assoc-ref
|
||||
'(("scheduled" . "info")
|
||||
("started" . "primary")
|
||||
("succeeded" . "success")
|
||||
("failed" . "danger")
|
||||
("failed-dependency" . "warning")
|
||||
("failed-other" . "danger")
|
||||
("canceled" . "default")
|
||||
("" . "default"))
|
||||
(assoc-ref status "status"))))
|
||||
(style "display: inline-block; font-size: 1.2em; margin-top: 0.4em;"))
|
||||
,(build-status-value->display-string
|
||||
(assoc-ref status "status"))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue