aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-03-14 01:08:40 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-03-15 01:43:12 +0100
commit039daab5583a4404d287b8097f9cb62f375c9b7b (patch)
treec89d4d5ab42061df31029e533c1c96e077d41c80
parentDirectory table extra filetypes. (diff)
downloadcalp-039daab5583a4404d287b8097f9cb62f375c9b7b.tar.gz
calp-039daab5583a4404d287b8097f9cb62f375c9b7b.tar.xz
Directory table file sizes.
-rw-r--r--module/calp/server/routes.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/module/calp/server/routes.scm b/module/calp/server/routes.scm
index 06bbe193..fe5ff4ae 100644
--- a/module/calp/server/routes.scm
+++ b/module/calp/server/routes.scm
@@ -50,7 +50,7 @@
(define (directory-table dir)
`(table
(thead
- (tr (th "") (th "Name") (th "Perm")))
+ (tr (th "") (th "Name") (th "Perm") (th "Size")))
(tbody
,@(map (lambda (k)
(let* ((stat (lstat (path-append dir k))))
@@ -65,6 +65,11 @@
[else "🙃"]))
(td (a (@ (href "/" ,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)))))))
(cdr (or (scandir dir)
(scm-error
'misc-error