From 05ccd049c5161cdfa7ec04ed9b38077a45314bc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 15 Mar 2022 02:05:10 +0100 Subject: Introduce directory-listing.scss --- module/calp/server/routes.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'module/calp/server/routes.scm') diff --git a/module/calp/server/routes.scm b/module/calp/server/routes.scm index 2e282f91..ee1f3cb2 100644 --- a/module/calp/server/routes.scm +++ b/module/calp/server/routes.scm @@ -48,7 +48,7 @@ ;; Note that the exported url is currently hard-coded to ;; start with /static. (define (directory-table prefix dir) - `(table + `(table (@ (class "directory-table")) (thead (tr (th "") (th "Name") (th "Perm") (th "Size"))) (tbody @@ -72,8 +72,6 @@ (td (a (@ (href ,(path-append "/static" dir k))) ,k)) (td ,(number->string (stat:perms stat) 8)) - ;; TODO replace with stylesheet containing - ;; td:nth-child(3} { text-align: end; } (td (@ (style "text-align:end")) (data (@ (value ,(stat:size stat))) ,(format #f "~:d" (stat:size stat))))))) @@ -480,7 +478,10 @@ (lambda () (return '((content-type text/html)) (sxml->html-string - (directory-table (static-dir) path)))) + `(html + (head (title "Calp directory listing for " path) + ,((@ (calp html components) include-css) "/static/directory-listing.css")) + (body ,(directory-table (static-dir) path)))))) (lambda (err proc fmt fmt-args data) (return (build-response code: 404) (format #f "~?" fmt fmt-args))))) -- cgit v1.2.3