summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2019-02-04 12:22:46 +0100
committerRicardo Wurmus <rekado@elephly.net>2019-02-04 12:22:46 +0100
commit40d64b150534f830bc99bf0adc5cb90d79ce4499 (patch)
tree2b007b1745ea73de4c12902413db960f9fba46aa
parent749e94aae843651093e4a8ed4ab83187806bdb59 (diff)
html: Show block info.
* mumi/web/view/html.scm (issue-page): Handle blocks and blockedby fields. * assets/css/screen.css: Add styles for blockedby and blocks lists.
-rw-r--r--assets/css/screen.css6
-rw-r--r--mumi/web/view/html.scm30
2 files changed, 34 insertions, 2 deletions
diff --git a/assets/css/screen.css b/assets/css/screen.css
index 45aea24..2e52ae4 100644
--- a/assets/css/screen.css
+++ b/assets/css/screen.css
@@ -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: ", ";
}
diff --git a/mumi/web/view/html.scm b/mumi/web/view/html.scm
index 0c33d53..1ba3c90 100644
--- a/mumi/web/view/html.scm
+++ b/mumi/web/view/html.scm
@@ -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"))