view: Hide details by default.
authorRicardo Wurmus <rekado@elephly.net>
Tue, 5 May 2020 13:02:03 +0000 (15:02 +0200)
committerRicardo Wurmus <rekado@elephly.net>
Tue, 5 May 2020 13:02:03 +0000 (15:02 +0200)
assets/css/screen.css
mumi/web/view/html.scm

index dc92b6d76ae955b315e0a0f266ae1be4965f625f..ca54c17521c8eccde9cfd3a097f3f69bbad3977f 100644 (file)
@@ -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;
index 40d9048a42c462b27a435a5d437855f36918d021..95da8c1f51e655f24addfbe70685570619d1aa53 100644 (file)
@@ -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."