aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/web
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-06-19 22:49:57 +0100
committerChristopher Baines <mail@cbaines.net>2019-06-19 22:49:57 +0100
commita168b23c24c9069ff7dc655d05a241b0c01513b3 (patch)
treec34c0d80b276ff78acb71a309c70786de7afab29 /guix-data-service/web
parente93b8f948e77c999b5048eb7118f6459373f15bc (diff)
downloaddata-service-a168b23c24c9069ff7dc655d05a241b0c01513b3.tar
data-service-a168b23c24c9069ff7dc655d05a241b0c01513b3.tar.gz
Add labels to revisions on the branches and branch pages
And always link to the revision page. Now the label let's you know if you should expect information or not for that revision.
Diffstat (limited to 'guix-data-service/web')
-rw-r--r--guix-data-service/web/view/html.scm48
1 files changed, 34 insertions, 14 deletions
diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm
index c837724..97ce2e4 100644
--- a/guix-data-service/web/view/html.scm
+++ b/guix-data-service/web/view/html.scm
@@ -666,24 +666,34 @@
(thead
(tr
(th (@ (class "col-md-3")) "Name")
- (th (@ (class "col-md-3")) "Date")
- (th (@ (class "col-md-3")) "Commit")))
+ (th (@ (class "col-md-2")) "Date")
+ (th (@ (class "col-md-7")) "Commit")))
(tbody
,@(map
(match-lambda
- ((name commit date revision-exists)
+ ((name commit date revision-exists? job-events)
`(tr
(td
(a (@ (href ,(string-append "/branch/" name)))
,name))
(td ,date)
- (td ,(if (string=? revision-exists "t")
+ (td ,(if (string=? commit "NULL")
+ '(samp "branch deleted")
`(a (@ (href ,(string-append
"/revision/" commit)))
- (samp ,commit))
- `(samp ,(if (string=? commit "NULL")
- "branch deleted"
- commit)))))))
+ (samp ,commit)
+ " "
+ ,(cond
+ (revision-exists?
+ '(span
+ (@ (class "label label-success"))
+ "✓"))
+ ((member "failure" job-events)
+ '(span (@ (class "label label-danger"))
+ "Failed to import data"))
+ (else
+ '(span (@ (class "label label-default"))
+ "No information yet")))))))))
branches-with-most-recent-commits)))))))))
(define (view-branch branch-name query-parameters
@@ -744,16 +754,26 @@
(tbody
,@(map
(match-lambda
- ((commit date revision-exists)
+ ((commit date revision-exists? job-events)
`(tr
(td ,date)
- (td ,(if (string=? revision-exists "t")
+ (td ,(if (string=? commit "NULL")
+ '(samp "branch deleted")
`(a (@ (href ,(string-append
"/revision/" commit)))
- (samp ,commit))
- `(samp ,(if (string=? commit "NULL")
- "branch deleted"
- commit)))))))
+ (samp ,commit)
+ " "
+ ,(cond
+ (revision-exists?
+ '(span
+ (@ (class "label label-success"))
+ "✓"))
+ ((member "failure" job-events)
+ '(span (@ (class "label label-danger"))
+ "Failed to import data"))
+ (else
+ '(span (@ (class "label label-default"))
+ "No information yet")))))))))
branch-commits)))))))))
(define (view-builds stats builds)