From d90751624c03f913360bff6a8c208ce19e683235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 7 Nov 2018 13:53:22 +0100 Subject: 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. --- src/cuirass/templates.scm | 41 ++++++++++++++++++++++++++++------------- 1 file 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)))) -- cgit v1.2.3