From ea80311c496b482e1360b5eee730f7f032c62c3d Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 19 Jun 2019 23:12:20 +0100 Subject: Use revision labels on the index page as well Also flip the branch and revision columns around, and add date information to the branch column. --- guix-data-service/web/controller.scm | 3 ++- guix-data-service/web/view/html.scm | 34 ++++++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 11 deletions(-) (limited to 'guix-data-service/web') diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm index a812570..a6330d8 100644 --- a/guix-data-service/web/controller.scm +++ b/guix-data-service/web/controller.scm @@ -627,9 +627,10 @@ git-repository-details (map (match-lambda - ((id job-id commit source) + ((id job-id job-events commit source) (list id job-id + job-events commit source (git-branches-for-commit conn commit)))) diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm index 97ce2e4..6e7fa62 100644 --- a/guix-data-service/web/view/html.scm +++ b/guix-data-service/web/view/html.scm @@ -274,25 +274,39 @@ (@ (class "table")) (thead (tr + (th (@ (class "col-md-6")) "Branch") (th (@ (class "col-md-6")) "Commit"))) (tbody ,@(map (match-lambda - ((id job-id commit source branches) + ((id job-id job-events commit source branches) `(tr - (td ,(if (string-null? id) - `(samp ,commit) - `(a (@ (href ,(string-append - "/revision/" commit))) - (samp ,commit)))) (td ,@(map (match-lambda ((name date) - `(a (@ (href ,(string-append - "/branch/" name))) - ,name))) - branches))))) + `(span + (a (@ (href ,(string-append + "/branch/" name))) + ,name) + " at " + ,date))) + branches)) + (td (a (@ (href ,(string-append + "/revision/" commit))) + (samp ,commit) + " " + ,(cond + ((not (string-null? id)) + '(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")))))))) revisions)))))))) git-repositories-and-revisions))))) -- cgit v1.2.3