(define-module (guix-qa-frontpage view home) #:use-module (srfi srfi-1) #:use-module (ice-9 match) #:use-module (guix-qa-frontpage view util) #:export (home readme)) (define (home branches) (layout #:description "Guix Quality Assurance" #:body `((main (div (@ (class "row")) (section (a (@ (href "/branch/master")) (h2 "branch: master")))) (h2 ,(gettext "Patches" "guix-qa-frontpage")) (div (@ (class "row")) (section (a (@ (href "/patches")) "List of issues for patches"))) (h2 "Branches") (div (@ (class "row")) (section (table (thead (tr (th "Branch") (th "Request to merge"))) (tbody ,@(append-map (match-lambda ((branch . details) (let ((issue-number (assoc-ref details "issue_number"))) `((tr (td (a (@ (href ,(string-append "/branch/" branch)) (style "font-family: monospace;")) ,branch)) (td ,@(if issue-number `((a (@ (href ,(string-append "https://issues.guix.gnu.org/" (number->string issue-number)))) "#" ,issue-number)) '()))))))) branches))))) (p (@ (style "width: unset; text-align: center;")) "qa.guix.gnu.org is powered by the Guix qa-frontpage." (br) "Find the code in " (a (@ (href "https://git.savannah.gnu.org/cgit/guix/qa-frontpage.git/")) "this git repository") " and send patches to " (a (@ (href "mailto:guix-devel@gnu.org")) "guix-devel@gnu.org") "."))))) (define (readme contents) (layout #:description "Guix Quality Assurance" #:body `((main (raw ,contents)))))