diff options
Diffstat (limited to 'index.skb')
-rw-r--r-- | index.skb | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/index.skb b/index.skb new file mode 100644 index 0000000..4cc7dee --- /dev/null +++ b/index.skb @@ -0,0 +1,53 @@ +(use-modules (srfi srfi-1) + (srfi srfi-19) + (srfi srfi-28) + (tissue issue) + (tissue web)) + +(define %forgotten-threshold + ;; 90 days + 90) + +(define (forgotten-issue? issue) + "Return #t if ISSUE is forgotten. Else, return #f. An issue is +considered forgotten if there has been no activity for longer than +%forgotten-threshold days." + (time<? (date->time-monotonic (issue-last-updated-date issue)) + (subtract-duration (date->time-monotonic (current-date)) + (make-time time-duration 0 + (* %forgotten-threshold 24 60 60))))) + +(define (unanswered-issue? issue) + "Return #t if ISSUE is unanswered. Else, return #f. An issue is +considered unanswered if none but the creator of the issue has posted +to it." + (= (length (delete-duplicates + (map post-author + (issue-posts issue)))) + 1)) + +(define (numbered-issue-listing title-format issues) + (section :title (format title-format (length issues)) + :number #f + (issue-listing (reverse issues)))) + +(document :title "GeneNetwork issue tracker" + (ref :url "team.html" :text "Team agenda view") + (numbered-issue-listing "~a unanswered issues" + (filter (lambda (issue) + (and (issue-open? issue) + (unanswered-issue? issue))) + (issues))) + (numbered-issue-listing "~a forgotten issues" + (filter (lambda (issue) + (and (issue-open? issue) + (forgotten-issue? issue))) + (issues))) + (numbered-issue-listing "~a active issues" + (filter (lambda (issue) + (and (issue-open? issue) + (not (forgotten-issue? issue)) + (not (unanswered-issue? issue)))) + (issues))) + (numbered-issue-listing "~a closed issues" + (remove issue-open? (issues)))) |