From 521b8c77d96dc4a6217610408da85566399035a2 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Thu, 27 Mar 2014 16:06:01 -0700 Subject: [PATCH] dashboard update --- server-extras/poldash.css | 5 +++++ server-routes.rkt | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/server-extras/poldash.css b/server-extras/poldash.css index 437c356..855c888 100644 --- a/server-extras/poldash.css +++ b/server-extras/poldash.css @@ -53,6 +53,11 @@ td { text-align: center; } +td.no-files { + padding: 0.4em; +} + + a:hover { background: #eee; } diff --git a/server-routes.rkt b/server-routes.rkt index 1ce89f2..daf8809 100644 --- a/server-routes.rkt +++ b/server-routes.rkt @@ -149,10 +149,10 @@ text))))) (define (make-parent-row) - (define dirs (cons "Project root" - (if (not (equal? (world:current-project-root) dashboard-dir)) - (explode-path (find-relative-path (world:current-project-root) dashboard-dir)) - null))) + (define title (string-append "Project root" (if (equal? (world:current-project-root) dashboard-dir) (format " = ~a" dashboard-dir) ""))) + (define dirs (cons title (if (not (equal? (world:current-project-root) dashboard-dir)) + (explode-path (find-relative-path (world:current-project-root) dashboard-dir)) + null))) (define dirlinks (cons "/" (map (λ(ps) (format "/~a/" (apply build-path ps))) (for/list ([i (length (cdr dirs))]) (take (cdr dirs) (add1 i)))))) @@ -193,7 +193,9 @@ (body-wrapper `(table ,@(cons (make-parent-row) - (map make-path-row project-paths))))) + (if (not (null? project-paths)) + (map make-path-row project-paths) + (list '(tr (td ((class "no-files")) "No files yet in this directory") (td) (td)))))))) (define route-dashboard (route-wrapper dashboard))