From 8853817f70659cf7888d9262d291e00081f94fcb Mon Sep 17 00:00:00 2001 From: Conor Finegan Date: Thu, 20 Jul 2017 10:35:34 -0400 Subject: [PATCH] Added todo category for no description, added warnings in table for todos. --- src/site.rkt | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/src/site.rkt b/src/site.rkt index 0aac585..bd1b5b4 100644 --- a/src/site.rkt +++ b/src/site.rkt @@ -638,24 +638,31 @@ ,(~a (- (package-last-updated pkg)))) ,@(maybe-splice (< (- now (package-last-updated pkg)) recent-seconds) - `(span ((class "label label-info")) "New"))) + `(p (span ((class "label label-info")) "New"))) + ,@(maybe-splice + (> 0 todokey) + (label-p (if (< todokey 5) + "label-warning" + "label-danger") "Todo"))) (td (h2 ,(package-link (package-name pkg))) ,(authors-list (package-authors pkg))) - (td (p ,(package-description pkg)) - ,@(maybe-splice - (or has-docs? has-readme?) - `(div - (span ((class "doctags-label")) "Docs: ") - ,(doc-links (package-docs pkg)) - ,@(maybe-splice has-readme? - " " - `(a ((href ,(package-readme-url pkg))) - "README")))) - ,@(maybe-splice - has-tags? - `(div - (span ((class "doctags-label")) "Tags: ") - ,(tag-links (package-tags pkg))))) + (td (p ,(if (string=? "" (package-description pkg)) + `(span ((class "label-warning")) "This package needs a description") + (package-description pkg))) + ,(if (not (or has-docs? has-readme?)) + (label-p "label-warning" "This package needs documentation") + `(div + (span ((class "doctags-label")) "Docs: ") + ,(doc-links (package-docs pkg)) + ,@(maybe-splice has-readme? + " " + `(a ((href ,(package-readme-url pkg))) + "README")))) + ,(if (not has-tags?) + (label-p "label-warning" "This package needs tags") + `(div + (span ((class "doctags-label")) "Tags: ") + ,(tag-links (package-tags pkg))))) ,(build-status-td pkg) (td ((style "display: none")) ,(number->string todokey)))) (values (cons row-xexp pkg-rows) @@ -663,6 +670,9 @@ ;; for/fold reverses pkg-rows, so un-reverse before returning. (values (reverse pkg-rows) num-todos)) +(define (label-p cls txt) + `(p (span ((class ,cls)) ,txt))) + (define (build-status-td pkg) ;; Build the index page cell for summarizing a package's build status. ;; Nothing at all is for no information on build success or failure.