diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-08-07 09:28:51 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-08-07 09:28:51 -0400 |
commit | d8d6c0877391afc8d089632317399bbfdd409229 (patch) | |
tree | 6422a94a417bc23bf5331af2a63544a234ee8959 | |
parent | 0084cc96cb575d268e80f5771e5c6179a089ea07 (diff) |
Add "versions" to package count badge.
* guix-web (view-package): Pluralize "version" if needed and render next
to package count.
-rwxr-xr-x | guix-web | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -206,6 +206,13 @@ (dd ,(render-package-license package)))) (let ((packages (find-packages-by-name name))) + (define (format-package-count) + (let ((count (length packages))) + (format #f "~d ~a" + count + (if (> count 1) + "versions" + "version")))) `(html (head (title ,(string-append "GNU Guix - " name)) @@ -214,7 +221,8 @@ (body (div (@ (class "container")) (image (@ (src "/images/logo.png"))) - (h1 ,name (span (@ (class "badge")) ,(length packages))) + (h1 ,name (span (@ (class "badge")) + ,(format-package-count))) (ul (@ (class "list-unstyled")) ,@(map (lambda (p) `(li ,(describe-package p))) |