(define-module (guix-qa-frontpage view patches) #:use-module (srfi srfi-1) #:use-module (ice-9 match) #:use-module (guix-qa-frontpage view util) #:export (patches-view)) (define (patches-view latest-series systems-with-low-substitute-availability) (layout #:title "Patches" #:body `((main (p "The aim with this page is that the patches to look at should be towards the top.") (p "For issues with the green status (important checks passing), the oldest ones will appear first.") ,@(if (or (eq? #f systems-with-low-substitute-availability) (null? systems-with-low-substitute-availability)) '() `((p (@ (style "text-align: center; font-weight: bold;")) "Builds for new patch series suspended as " (a (@ (href "/branch/master")) "master branch substitute availability") " is low for: " ,@(append-map (lambda (system) `((span (@ (style "font-family: monospace;")) ,system " "))) systems-with-low-substitute-availability)))) (table (tbody ,@(map (match-lambda ((id . details) (let ((status (assq-ref details 'overall-status))) `(tr (td (a (@ (href ,(simple-format #f "/issue/~A" id))) ,id)) (td (@ (style "vertical-align: middle;")) ,@(cond ((eq? status 'important-checks-passing) `((span (@ (aria-label "status: green") (class "green-dot")) (*ENTITY* "#10004")))) ((eq? status 'important-checks-failing) `((span (@ (aria-label "status: red") (class "red-dot")) (*ENTITY* "#10005")))) ((eq? status 'needs-looking-at) `((span (@ (aria-label "status: orange") (class "orange-dot")) (*ENTITY* "#9888")))) (else `((span (@ (aria-label "status: grey") (class "grey-dot")) "?"))))) (td (@ (style "text-align: left;")) ,(assoc-ref details "name")))))) latest-series)))))))