1
0
Fork 0

Show subfolders separately

Recurse into subfolders when showing project list.
This commit is contained in:
Tom Willemsen 2012-09-11 21:44:34 +02:00
parent d2f68a3423
commit cf5d90a257

View file

@ -19,12 +19,11 @@
(list name (map remove-stat children))))) (list name (map remove-stat children)))))
(define (list-projects) (define (list-projects)
(let ((start #t)) (remove-stat
(cadr (remove-stat (file-system-tree (file-system-tree
*projects-dir* *projects-dir*
(lambda params (lambda (name stat)
(and start (not (file-exists? (string-append name "/config")))))))
(begin (set! start #f) #t))))))))
(define (project-description project) (define (project-description project)
(let ((dfile-name (let ((dfile-name
@ -49,8 +48,18 @@
"never" "never"
relative-last-update))) relative-last-update)))
(define (page-projects request body index) (define (project->row project)
(respond `((table (@ (class "table table-condensed table-striped")) `(tr
(td ,project)
(td ,(project-description project))
(td ,(git-last-update project))
(td "")))
(define (project-list->table list lvl)
(let ((head (car list))
(body (cadr list)))
`((,(string->symbol (string-append "h" (number->string lvl))) ,head)
(table (@ (class "table table-condensed table-striped"))
(thead (thead
(tr (tr
(th "Name") (th "Name")
@ -58,12 +67,10 @@
(th "Last update") (th "Last update")
(th ""))) (th "")))
(tbody (tbody
,@(map ,@(map project->row (filter string? body))))
(lambda (elt) ,@(map (lambda (elt) (project-list->table elt (1+ lvl)))
`(tr (filter list? body)))))
(td ,elt)
(td ,(project-description elt)) (define (page-projects request body index)
(td ,(git-last-update elt)) (respond (project-list->table (list-projects) 1)
(td "")))
(list-projects)))))
#:extra-headers '((pragma . (no-cache (broccoli . "tastyy")))))) #:extra-headers '((pragma . (no-cache (broccoli . "tastyy"))))))