diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-11-07 13:53:22 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-11-07 15:28:05 +0100 |
commit | d90751624c03f913360bff6a8c208ce19e683235 (patch) | |
tree | ecb614158371320d15a3916bfb0b0384952bdf37 | |
parent | e50e1e5fdf6aca3bf964376469316813349660d6 (diff) | |
download | cuirass-d90751624c03f913360bff6a8c208ce19e683235.tar cuirass-d90751624c03f913360bff6a8c208ce19e683235.tar.gz |
templates: Distinguish among the various failure cases.
* src/cuirass/templates.scm (build-eval-table)[table-row]: Use the
'build-status' macro instead of numeric values. Distinguish the
'cancel' and 'failed-dependency' cases from other failure cases.
-rw-r--r-- | src/cuirass/templates.scm | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm index d4968d7..902a70d 100644 --- a/src/cuirass/templates.scm +++ b/src/cuirass/templates.scm @@ -21,6 +21,7 @@ #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module ((cuirass database) #:select (build-status)) #:export (html-page specifications-table evaluation-info-table @@ -198,19 +199,33 @@ and BUILD-MAX are global minimal and maximal (stoptime, rowid) pairs." (define (table-row build) `(tr - (td ,(case (assq-ref build #:buildstatus) - ((0) `(span (@ (class "oi oi-check text-success") - (title "Succeeded") - (aria-hidden "true")) - "")) - ((1 2 3 4) `(span (@ (class "oi oi-x text-danger") - (title "Failed") - (aria-hidden "true")) - "")) - (else `(span (@ (class "oi oi-clock text-warning") - (title "Scheduled") - (aria-hidden "true")) - "")))) + (td ,(let ((status (assq-ref build #:buildstatus))) + (cond + ((= (build-status succeeded) status) + `(span (@ (class "oi oi-check text-success") + (title "Succeeded") + (aria-hidden "true")) + "")) + ((= (build-status scheduled) status) + `(span (@ (class "oi oi-clock text-warning") + (title "Scheduled") + (aria-hidden "true")) + "")) + ((= (build-status canceled) status) + `(span (@ (class "oi oi-question-mark text-warning") + (title "Canceled") + (aria-hidden "true")) + "")) + ((= (build-status failed-dependency) status) + `(span (@ (class "oi oi-warning text-danger") + (title "Dependency failed") + (aria-hidden "true")) + "")) + (else + `(span (@ (class "oi oi-x text-danger") + (title "Failed") + (aria-hidden "true")) + ""))))) (th (@ (scope "row")),(assq-ref build #:id)) (td ,(assq-ref build #:jobset)) (td ,(strftime "%c" (localtime (assq-ref build #:stoptime)))) |