aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix-data-service/web/build/html.scm1
-rw-r--r--guix-data-service/web/html-utils.scm33
-rw-r--r--guix-data-service/web/revision/html.scm1
-rw-r--r--guix-data-service/web/view/html.scm30
4 files changed, 34 insertions, 31 deletions
diff --git a/guix-data-service/web/build/html.scm b/guix-data-service/web/build/html.scm
index 679cda6..a0956b0 100644
--- a/guix-data-service/web/build/html.scm
+++ b/guix-data-service/web/build/html.scm
@@ -18,6 +18,7 @@
(define-module (guix-data-service web build html)
#:use-module (ice-9 match)
#:use-module (guix-data-service web query-parameters)
+ #:use-module (guix-data-service web html-utils)
#:use-module (guix-data-service web view html)
#:export (view-builds))
diff --git a/guix-data-service/web/html-utils.scm b/guix-data-service/web/html-utils.scm
index e568289..db25928 100644
--- a/guix-data-service/web/html-utils.scm
+++ b/guix-data-service/web/html-utils.scm
@@ -17,7 +17,10 @@
(define-module (guix-data-service web html-utils)
#:use-module (ice-9 match)
- #:export (sexp-div))
+ #:export (sexp-div
+
+ build-status-value->display-string
+ build-status-span))
(define (sexp-div sexp)
(match sexp
@@ -33,3 +36,31 @@
,hash))
((and string val)
val)))
+
+(define (build-status-value->display-string value)
+ (assoc-ref
+ '(("scheduled" . "Scheduled")
+ ("started" . "Started")
+ ("succeeded" . "Succeeded")
+ ("failed" . "Failed")
+ ("failed-dependency" . "Failed (dependency)")
+ ("failed-other" . "Failed (other)")
+ ("canceled" . "Canceled")
+ ("" . "Unknown"))
+ value))
+
+(define (build-status-span 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"))
+ status)))
+ (style "display: inline-block; font-size: 1.2em; margin-top: 0.4em;"))
+ ,(build-status-value->display-string status)))
diff --git a/guix-data-service/web/revision/html.scm b/guix-data-service/web/revision/html.scm
index f1e2dec..f6c870d 100644
--- a/guix-data-service/web/revision/html.scm
+++ b/guix-data-service/web/revision/html.scm
@@ -22,6 +22,7 @@
#:use-module (texinfo html)
#:use-module (json)
#:use-module (guix-data-service web util)
+ #:use-module (guix-data-service web html-utils)
#:use-module (guix-data-service web query-parameters)
#:use-module (guix-data-service web view html)
#:export (view-revision-news
diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm
index 753cb24..ee3d4c7 100644
--- a/guix-data-service/web/view/html.scm
+++ b/guix-data-service/web/view/html.scm
@@ -36,8 +36,6 @@
display-possible-store-item
display-store-item
display-store-item-short
- build-status-value->display-string
- build-status-span
table/branches-with-most-recent-commits
@@ -359,34 +357,6 @@
"No information yet")))))))))
branches-with-most-recent-commits))))
-(define (build-status-value->display-string value)
- (assoc-ref
- '(("scheduled" . "Scheduled")
- ("started" . "Started")
- ("succeeded" . "Succeeded")
- ("failed" . "Failed")
- ("failed-dependency" . "Failed (dependency)")
- ("failed-other" . "Failed (other)")
- ("canceled" . "Canceled")
- ("" . "Unknown"))
- value))
-
-(define (build-status-span 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"))
- status)))
- (style "display: inline-block; font-size: 1.2em; margin-top: 0.4em;"))
- ,(build-status-value->display-string status)))
-
(define (display-possible-store-item value)
(match (string-split value #\/)
(("" "gnu" "store" item)