html: Show block info.
authorRicardo Wurmus <rekado@elephly.net>
Mon, 4 Feb 2019 11:22:46 +0000 (12:22 +0100)
committerRicardo Wurmus <rekado@elephly.net>
Mon, 4 Feb 2019 11:22:46 +0000 (12:22 +0100)
* mumi/web/view/html.scm (issue-page): Handle blocks and blockedby
fields.
* assets/css/screen.css: Add styles for blockedby and blocks lists.

assets/css/screen.css
mumi/web/view/html.scm

index 45aea2441698f378082af1c5221fda4cf0b5e4cc..2e52ae4b96b75567bbaa8f210afcecdcc85a079a 100644 (file)
@@ -61,10 +61,12 @@ h2 {
     padding-bottom: 5px;
 }
 
-ul.merged li {
+ul.merged li, ul.blockedby li, ul.blocks li {
     display: inline-block;
 }
-ul.merged li + li:before {
+ul.merged li + li:before,
+ul.blockedby li + li:before,
+ul.blocks li + li:before {
     content: ", ";
 }
 
index 0c33d53647451f6ba74fd1c7dafd55c649c019d4..1ba3c907fc07a43e2fa4d5686901119b9d599a0c 100644 (file)
@@ -354,6 +354,36 @@ range.  The supported arguments are the same as for "
                                   (string-split str #\space))
                                  ((? number? n)
                                   (list (number->string n)))))))
+                   '())
+             ,@(if (bug-blocks bug)
+                   `((ul (@ (class "blocks"))
+                         "Blocks: "
+                         ,(map (lambda (id)
+                                 `(li (a (@ (href ,(string-append "/issue/" id)))
+                                         ,id)))
+                               ;; XXX: This field can either hold a
+                               ;; string of multiple ids, or a single
+                               ;; number.  Deal with this mess.
+                               (match (bug-blocks bug)
+                                 ((? string? str)
+                                  (string-split str #\space))
+                                 ((? number? n)
+                                  (list (number->string n)))))))
+                   '())
+             ,@(if (bug-blockedby bug)
+                   `((ul (@ (class "blockedby"))
+                         "Blocked by: "
+                         ,(map (lambda (id)
+                                 `(li (a (@ (href ,(string-append "/issue/" id)))
+                                         ,id)))
+                               ;; XXX: This field can either hold a
+                               ;; string of multiple ids, or a single
+                               ;; number.  Deal with this mess.
+                               (match (bug-blockedby bug)
+                                 ((? string? str)
+                                  (string-split str #\space))
+                                 ((? number? n)
+                                  (list (number->string n)))))))
                    '())))
       (div
        (@ (class "row"))