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 +++++---- static/Makefile | 2 +- static/directory-listing.scss | 5 +++++ 3 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 static/directory-listing.scss 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))))) diff --git a/static/Makefile b/static/Makefile index 2897c6bb..1979575d 100644 --- a/static/Makefile +++ b/static/Makefile @@ -1,6 +1,6 @@ .PHONY: all install clean watch -TARGETS := style.css smallcal.css script.out.js +TARGETS := style.css smallcal.css script.out.js directory-listing.css WATCH= # script explicitly named, since that is our entry point diff --git a/static/directory-listing.scss b/static/directory-listing.scss new file mode 100644 index 00000000..745b5bc3 --- /dev/null +++ b/static/directory-listing.scss @@ -0,0 +1,5 @@ +@import 'global'; + +.directory-table td:nth-child(3) { + text-align: end; +} -- cgit v1.2.3