diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2020-05-05 15:02:03 +0200 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2020-05-05 15:02:03 +0200 |
commit | fb486bd3a218f035a3180c86f26fa5d4c88bb391 (patch) | |
tree | 2d67cbe10973707b7395c9ce4e7421d0598f3ef3 | |
parent | ccf033a8d9ce01f9439473629b4fb5687674026a (diff) |
view: Hide details by default.
-rw-r--r-- | assets/css/screen.css | 7 | ||||
-rw-r--r-- | mumi/web/view/html.scm | 225 |
2 files changed, 118 insertions, 114 deletions
diff --git a/assets/css/screen.css b/assets/css/screen.css index dc92b6d..ca54c17 100644 --- a/assets/css/screen.css +++ b/assets/css/screen.css @@ -152,8 +152,9 @@ table { } .info .stat { - display: block; + display: inline-grid; color: #586069; + margin-right: 1em; } .info .stat .label { display: block; @@ -199,6 +200,10 @@ table { } } +details { + margin-top: .5em; +} + .message .body pre { background: transparent; border: none; diff --git a/mumi/web/view/html.scm b/mumi/web/view/html.scm index 40d9048..95da8c1 100644 --- a/mumi/web/view/html.scm +++ b/mumi/web/view/html.scm @@ -315,51 +315,51 @@ failed to process associated messages.") (extract-email b))))) (define (show-message message-number message previous-subject) `((div (@ (class "mb-5")) - (a (@ (id ,(number->string message-number)))) - (div - (@ (class "avatar") - (style ,(string-append "background-color:" - (avatar-color (sender-email message) - (map extract-email parties))))) - ,(string-upcase (string-take (sender-name message) 1))) - (div - (@ (class "message")) - (div - (@ (class "card")) - (div - (@ (class "card-header")) - (div - (@ (class "from")) + (a (@ (id ,(number->string message-number)))) (div (@ (class "avatar") (style ,(string-append "background-color:" (avatar-color (sender-email message) (map extract-email parties))))) ,(string-upcase (string-take (sender-name message) 1))) - (span (@ (class "address")) ,(sender-name message)) - " wrote on " - (span (@ (class "date")) - (a (@ (href ,(string-append "#" (number->string - message-number)))) - ,(date->string (date message))))) - ,@(if (string-suffix? previous-subject (subject message)) - '() - `((div (@ (class "subject")) ,(subject message)))) - (div - (@ (class "details")) (div - (@ (class "recipients")) - (label "Recipients:") - ,(map (lambda (address) - `(span (@ (class "address")) ,address)) - (recipients message))) - (div - (@ (class "message-id")) - (label "Message-ID:") - ,(message-id message)))) - (div - (@ (class "body card-body")) - ,(display-message-body id message-number message))))) + (@ (class "message")) + (div + (@ (class "card")) + (div + (@ (class "card-header")) + (div + (@ (class "from")) + (div + (@ (class "avatar") + (style ,(string-append "background-color:" + (avatar-color (sender-email message) + (map extract-email parties))))) + ,(string-upcase (string-take (sender-name message) 1))) + (span (@ (class "address")) ,(sender-name message)) + " wrote on " + (span (@ (class "date")) + (a (@ (href ,(string-append "#" (number->string + message-number)))) + ,(date->string (date message))))) + ,@(if (string-suffix? previous-subject (subject message)) + '() + `((div (@ (class "subject")) ,(subject message)))) + (div + (@ (class "details")) + (div + (@ (class "recipients")) + (label "Recipients:") + ,(map (lambda (address) + `(span (@ (class "address")) ,address)) + (recipients message))) + (div + (@ (class "message-id")) + (label "Message-ID:") + ,(message-id message)))) + (div + (@ (class "body card-body")) + ,(display-message-body id message-number message))))) ,@(if (closing? message id) '((div (@ (class "row event")) @@ -397,54 +397,81 @@ failed to process associated messages.") ;; non-ASCII characters. (sender-name (first messages)) ".") - ,@(if (bug-mergedwith bug) - `((ul (@ (class "merged")) - "Merged with: " - ,(map (lambda (id) - `(li (a (@ (href ,(string-append "/" id))) - ,id))) - ;; XXX: This field can either hold a - ;; string of multiple ids, or a single - ;; number. Deal with this mess. - (match (bug-mergedwith bug) - ((? string? str) - (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 "/" 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 "/" 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))))))) - '()))) + (details + (@ (class "info")) + (summary "Details") + (dl + (@ (class "stat")) + ,@(let ((num (length parties))) + `((dt ,(if (= num 1) + "One participant" + (string-append (number->string num) + " participants"))) + (dd + (ul ,(map (lambda (name) + `(li (span (@ (class "name"))) + ,name)) + (map extract-name parties))))))) + (dl + (@ (class "stat")) + (dt "Owner") + (dd + ,(or (and=> (bug-owner bug) extract-name) "unassigned"))) + (dl + (@ (class "stat")) + (dt "Severity") + (dd ,(bug-severity bug))) + ,@(if (bug-mergedwith bug) + `((dl + (@ (class "stat")) + (dt "Merged with") + (dd (ul ,(map (lambda (id) + `(li (a (@ (href ,(string-append "/" id))) + ,id))) + ;; XXX: This field can either hold a + ;; string of multiple ids, or a single + ;; number. Deal with this mess. + (match (bug-mergedwith bug) + ((? string? str) + (string-split str #\space)) + ((? number? n) + (list (number->string n))))))))) + '()) + ,@(if (bug-blocks bug) + `((dl + (@ (class "stat")) + (dt "Blocks") + (dd (ul ,(map (lambda (id) + `(li (a (@ (href ,(string-append "/" 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) + `((dl + (@ (class "stat")) + (dt "Blocked by") + (dd (ul ,(map (lambda (id) + `(li (a (@ (href ,(string-append "/" 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")) (div - (@ (class "conversation col-lg-9")) + (@ (class "conversation col-12")) ,(let ((msgs (filter (lambda (msg) ;; Ignore messages ;; without body, and @@ -512,35 +539,7 @@ supported. To comment on this conversation " (number->string id) "@" (%config 'debbugs-domain) "?subject=" (bug-subject* bug)))) ,(string-append "send email to " - (number->string id) "@" (%config 'debbugs-domain))))))))))) - - (div - (@ (class "info col-lg-3")) - (dl - (@ (class "stat")) - ,@(let ((num (length parties))) - `((dt ,(if (= num 1) - "One participant" - (string-append (number->string num) - " participants"))) - (dd - (ul ,(map (lambda (name) - `(li (span (@ (class "name"))) - ,name)) - (map extract-name parties))))))) - (dl - (@ (class "stat")) - (dt "Owner") - (dd - ,(or (and=> (bug-owner bug) extract-name) "unassigned"))) - (dl - (@ (class "stat")) - (dt "Severity") - (dd ,(bug-severity bug))) - (dl - (@ (class "stat")) - (dt "Status") - (dd ,(status-tag bug)))))))))) + (number->string id) "@" (%config 'debbugs-domain))))))))))))))))) (define (list-of-bugs bugs) "Return table rows for all BUGS." |