aboutsummaryrefslogtreecommitdiff
path: root/guix-qa-frontpage/view/branches.scm
blob: 9573d2b861bd86a983f571bbf56d26f8c64ef895 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
(define-module (guix-qa-frontpage view branches)
  #:use-module (srfi srfi-1)
  #:use-module (ice-9 match)
  #:use-module (guix-qa-frontpage view util)
  #:export (branches-view))

(define (branches-view branches)
  (layout
   #:title "Branches"
   #:body
   `((main
      (table
       (thead
        (tr (th "Branch")
            (th "Request to merge")))
       (tbody
        ,@(map (match-lambda
                 ((name . details)
                  (let ((issue-number
                         (assoc-ref details "issue_number")))
                    `(tr
                      (td (a (@ (href ,(simple-format #f "/branch/~A" name))
                                (style "font-family: monospace;"))
                             ,name))
                      (td ,@(if issue-number
                                `((a (@ (href ,(string-append
                                                "https://issues.guix.gnu.org/"
                                                (number->string issue-number))))
                                     "#" ,issue-number))
                                '()))))))
               branches)))))))