dashboard updates

pull/9/head
Matthew Butterick 11 years ago
parent 02c98719e8
commit 7c5c11489e

@ -86,7 +86,7 @@
;; todo: add extensions ;; todo: add extensions
(define binary-extensions (define binary-extensions
'(gif jpg jpeg mp3 png zip)) '(gif jpg jpeg mp3 png zip pdf ico tar ai eps))
(define/contract (has-binary-ext? x) (define/contract (has-binary-ext? x)
(pathish? . -> . boolean?) (pathish? . -> . boolean?)

@ -11,12 +11,17 @@ body {
table { table {
border-collapse:collapse; border-collapse:collapse;
width: 100%; width: 100%;
max-width: 900px;
} }
tr > td:first-child {
width: 0%;
}
tr > td:first-child + td { tr > td:first-child {
font-family: "Triplicate T4"; font-family: "Triplicate T4";
background: #f6f6f6; background: #f6f6f6;
text-align: left;
} }
tr, tr + tr { tr, tr + tr {
@ -25,7 +30,8 @@ tr, tr + tr {
td { td {
font-size: 17px; font-size: 17px;
width: 20%; line-height: 1.35;
text-align: center;
} }
a:hover { a:hover {
@ -36,7 +42,11 @@ a {
text-decoration: none; text-decoration: none;
color: #6a6; color: #6a6;
display: block; display: block;
padding: 1em; padding: 0.5em;
}
.file-ext {
color: #bbb;
} }
a:active { a:active {
@ -46,6 +56,5 @@ a:active {
tt { tt {
font-family: "AlixFB"; font-family: "AlixFB";
font-size: 100%; font-size: 100%;
white-space: pre; white-space: pre-wrap;
word-wrap: normal;
} }

@ -109,8 +109,7 @@
(define url-to-parent (string-replace url-to-parent-dashboard DASHBOARD_NAME "")) (define url-to-parent (string-replace url-to-parent-dashboard DASHBOARD_NAME ""))
`(tr ,@(map make-link-cell (list `(tr ,@(map make-link-cell (list
(cons url-to-parent-dashboard "") (cons url-to-parent-dashboard url-to-parent)
(cons url-to-parent url-to-parent)
empty-cell empty-cell
(cons #f "(parent dir)") (cons #f "(parent dir)")
empty-cell)))) empty-cell))))
@ -125,24 +124,27 @@
(define source (and (not (empty? possible-sources)) (->string (car possible-sources)))) (define source (and (not (empty? possible-sources)) (->string (car possible-sources))))
`(tr ,@(map make-link-cell `(tr ,@(map make-link-cell
(append (list (append (list
;; folder traversal cell (cond ;; main cell
(if (directory-exists? (build-path dir filename)) ; links subdir to its dashboard [(directory-exists? (build-path dir filename)) ; links subdir to its dashboard
(cons (format "~a/~a" filename DASHBOARD_NAME) "") (cons (format "~a/~a" filename DASHBOARD_NAME) (format "~a/" filename))]
empty-cell) [source (cons #f `(a ((href ,filename)) ,filename (span ((class "file-ext")) "." ,(get-ext source))))]
(cons filename filename) ; main cell [else (cons filename filename)])
(if source ; source cell (if needed)
(cons (format "raw/~a" source) (format "~a source" (get-ext source))) (cond ; source cell (if needed)
empty-cell) [(has-ext? filename POLLEN_TREE_EXT) (cons (format "raw/~a" filename) "ptree")]
[source (cons (format "raw/~a" source) "in")]
[else empty-cell])
(cond ; raw cell (if needed) (cond ; raw cell (if needed)
[(directory-exists? (build-path dir filename)) (cons #f "(subdir)")] [(directory-exists? (build-path dir filename)) (cons #f #f)]
[(has-binary-ext? filename) (cons #f "(binary)")] [(has-binary-ext? filename) (cons #f "(binary)")]
[else (cons (format "raw/~a" filename) "output")])) [(has-ext? filename POLLEN_TREE_EXT) empty-cell]
(if source [else (cons (format "raw/~a" filename) "out")]))
#|(if source
(list (list
(if (has-ext? source POLLEN_DECODER_EXT) ; xexpr cell for pollen decoder files (if (has-ext? source POLLEN_DECODER_EXT) ; xexpr cell for pollen decoder files
(cons (format "xexpr/~a" source) "xexpr") (cons (format "xexpr/~a" source) "xexpr")
empty-cell)) empty-cell))
(make-list 1 empty-cell)))))) (make-list 1 empty-cell))|#))))
(define (ineligible-path? x) (or (not (visible? x)) (member x RESERVED_PATHS))) (define (ineligible-path? x) (or (not (visible? x)) (member x RESERVED_PATHS)))
(define project-paths (filter-not ineligible-path? (directory-list dir))) (define project-paths (filter-not ineligible-path? (directory-list dir)))

@ -6,6 +6,12 @@
(define POLLEN_PREPROC_EXT 'p) (define POLLEN_PREPROC_EXT 'p)
(define POLLEN_DECODER_EXT 'pd) (define POLLEN_DECODER_EXT 'pd)
(define POLLEN_TREE_EXT 'ptree)
(define DEFAULT_POLLEN_TREE "main.ptree")
(define POLLEN_TREE_PARENT_NAME 'parent)
(define POLLEN_TREE_ROOT_NAME 'ptree-root)
(define TEMPLATE_FILE_PREFIX "-") (define TEMPLATE_FILE_PREFIX "-")
(define POLLEN_EXPRESSION_DELIMITER #\◊) (define POLLEN_EXPRESSION_DELIMITER #\◊)
(define TEMPLATE_FIELD_DELIMITER POLLEN_EXPRESSION_DELIMITER) (define TEMPLATE_FIELD_DELIMITER POLLEN_EXPRESSION_DELIMITER)
@ -14,10 +20,6 @@
(define FALLBACK_TEMPLATE_NAME "-temp-fallback-template.html") (define FALLBACK_TEMPLATE_NAME "-temp-fallback-template.html")
(define TEMPLATE_META_KEY "template") (define TEMPLATE_META_KEY "template")
(define POLLEN_TREE_EXT 'ptree)
(define DEFAULT_POLLEN_TREE "main.ptree")
(define POLLEN_TREE_PARENT_NAME 'parent)
(define POLLEN_TREE_ROOT_NAME 'ptree-root)
(define MAIN_POLLEN_EXPORT 'main) (define MAIN_POLLEN_EXPORT 'main)
;(define META_POLLEN_TAG 'metas) ;(define META_POLLEN_TAG 'metas)
@ -43,7 +45,7 @@
(require "readability.rkt") (require "readability.rkt")
(define RESERVED_PATHS (define RESERVED_PATHS
(map ->path (list POLLEN_COMMAND_FILE EXTRAS_DIR "poldash.css"))) (map ->path (list POLLEN_COMMAND_FILE EXTRAS_DIR "poldash.css" "compiled")))
(define PROJECT_ROOT (current-directory)) (define PROJECT_ROOT (current-directory))

Loading…
Cancel
Save