guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Mathieu Othacehe
Date: Wed, 26 May 2021 05:25:29 -0400 (EDT)

branch: master
commit 524b81d9ca6334dc322930a0ccc1d6830a81899b
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Wed May 26 11:24:30 2021 +0200

    Improve dependencies display.
    
    * src/cuirass/templates.scm (build-details): Print an underscore when there
    are no dependencies.
---
 src/cuirass/templates.scm | 58 ++++++++++++++++++++++++-----------------------
 1 file changed, 30 insertions(+), 28 deletions(-)

diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm
index 2cc440f..b816398 100644
--- a/src/cuirass/templates.scm
+++ b/src/cuirass/templates.scm
@@ -735,34 +735,36 @@ the existing SPEC otherwise."
            ,@(let ((dependencies
                     (assq-ref build #:builddependencies))
                    (max-items 9))
-               `(,(map (lambda (id index)
-                         (let* ((build (find-dependency id))
-                                (status (assoc-ref build #:status)))
-                           `((div
-                              ,@(if (> index max-items)
-                                    '((@ (class "collapse collapse-dep")))
-                                    '())
-                              (span (@ (class ,(status-class status))
-                                       (title ,(status-title status))
-                                       (aria-hidden "true"))
-                                    "")
-                              " "
-                              (a (@ (href "/build/" ,id "/details"))
-                                 ,(assoc-ref build #:nix-name))
-                              (br)))))
-                       dependencies
-                       (iota (length dependencies)))
-                 ,@(if (> (length dependencies) max-items)
-                       '((button (@ (id "collapse-dep-btn")
-                                    (class "btn btn-primary")
-                                    (type "button")
-                                    (data-toggle "collapse")
-                                    (data-target ".collapse-dep")
-                                    (aria-expanded "false")
-                                    (aria-controls "collapse-dep")
-                                    (aria-label "Toggle dependencies 
dropdown"))
-                                 "Show more"))
-                       '())))))
+               (if (> (length dependencies) 0)
+                   `(,(map (lambda (id index)
+                             (let* ((build (find-dependency id))
+                                    (status (assoc-ref build #:status)))
+                               `((div
+                                  ,@(if (> index max-items)
+                                        '((@ (class "collapse collapse-dep")))
+                                        '())
+                                  (span (@ (class ,(status-class status))
+                                           (title ,(status-title status))
+                                           (aria-hidden "true"))
+                                        "")
+                                  " "
+                                  (a (@ (href "/build/" ,id "/details"))
+                                     ,(assoc-ref build #:nix-name))
+                                  (br)))))
+                           dependencies
+                           (iota (length dependencies)))
+                     ,@(if (> (length dependencies) max-items)
+                           '((button (@ (id "collapse-dep-btn")
+                                        (class "btn btn-primary")
+                                        (type "button")
+                                        (data-toggle "collapse")
+                                        (data-target ".collapse-dep")
+                                        (aria-expanded "false")
+                                        (aria-controls "collapse-dep")
+                                        (aria-label "Toggle dependencies 
dropdown"))
+                                     "Show more"))
+                           '()))
+                   '("—")))))
       (tr (th "Outputs")
           (td ,(map (match-lambda ((out (#:path . path))
                                    `(pre ,path)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]