- (when icon-base
- (html-stream
- stream
- ((:img :border "0"
- :src (format nil "~Ablank.png" icon-base)
- :alt " "))))
- " "
- ((:a :href (format nil "~A?N=~A" this-url
- (if (and (eq sort-field :name) (eq dir :asc))
- "D" "A")))
- "Name")
- (:princ (format nil "~20A" ""))
- " "
- ((:a :href (format nil "~A?M=~A" this-url
- (if (and (eq sort-field :modified) (eq dir :asc))
- "D" "A")))
- "Last modified")
- " "
- ((:a :href (format nil "~A?S=~A" this-url
- (if (and (eq sort-field :size) (eq dir :asc))
- "D" "A")))
- "Size")
- " "
- ((:a :href (format nil "~A?D=~A" this-url
- (if (and (eq sort-field :description) (eq dir :asc))
- "D" "A")))
- "Description")
- :newline
- (:princ "<hr noshade align=\"left\" width=\"80%\">")
- :newline
- (when parent
- (html-stream
- stream
- (when icon-base
- (html-stream
- stream
- ((:img :border "0"
- :src (format nil "~Aback.png" icon-base
- :alt "[DIR]")))))
- " "
- (write-name-link stream (first parent) (second parent))
- " "
- (print-n-chars #\space 17 stream)
- " -"
- :newline))
- (dolist (entry entries)
- (html-stream
- stream
- (when icon-base
- (html-stream
- stream
- ((:img :border "0"
- :src
- (case (car entry)
- (:dir (format nil "~Afolder.png" icon-base))
- (:text (format nil "~Atext.png" icon-base))
- (t (format nil "~Af.png" icon-base)))
- :alt
- (case (car entry)
- (:dir "[DIR]")
- (:text "[TXT]")
- (t "[FIL]"))))))
- " "
- (write-name-link stream (second entry) (third entry))
- " "
- (:princ (universal-time-to-apache-date (fourth entry)))
- (:princ
- (cond
- ((or (eq :dir (first entry))
- (null (fifth entry)))
- " -")
- ((< (fifth entry) (* 1024 1024))
- (format nil "~5,' Dk" (round (fifth entry) 1024)))
- ((< (fifth entry) (* 1024 1024 1024))
- (format nil "~5,' Dm" (round (fifth entry) (* 1024 1024))))
- (t
- (format nil "~5,' Dg" (round (fifth entry) (* 1024 1024 1024))))
- ))
- " "
- (:princ
- (if (sixth entry)
- (sixth entry)
- ""))
- :newline)))
+ (when icon-base
+ (html-stream
+ stream
+ ((:img :border "0"
+ :src (format nil "~Ablank.png" icon-base)
+ :alt " "))))
+ " "
+ ((:a :href (format nil "~A?N=~A" this-url
+ (if (and (eq sort-field :name) (eq dir :asc))
+ "D" "A")))
+ "Name")
+ (:princ (format nil "~20A" ""))
+ " "
+ ((:a :href (format nil "~A?M=~A" this-url
+ (if (and (eq sort-field :modified) (eq dir :asc))
+ "D" "A")))
+ "Last modified")
+ " "
+ ((:a :href (format nil "~A?S=~A" this-url
+ (if (and (eq sort-field :size) (eq dir :asc))
+ "D" "A")))
+ "Size")
+ " "
+ ((:a :href (format nil "~A?D=~A" this-url
+ (if (and (eq sort-field :description) (eq dir :asc))
+ "D" "A")))
+ "Description")
+ :newline
+ (:princ "<hr noshade align=\"left\" width=\"80%\">")
+ :newline
+ (when parent
+ (html-stream
+ stream
+ (when icon-base
+ (html-stream
+ stream
+ ((:img :border "0"
+ :src (format nil "~Aback.png" icon-base)
+ :alt "[DIR]"))))
+ " "
+ (write-name-link stream (first parent) (second parent))
+ " "
+ (print-n-chars #\space 17 stream)
+ " -"
+ :newline))
+ (dolist (entry entries)
+ (html-stream
+ stream
+ (when icon-base
+ (html-stream
+ stream
+ ((:img :border "0"
+ :src
+ (case (car entry)
+ (:dir (format nil "~Afolder.png" icon-base))
+ (:text (format nil "~Atext.png" icon-base))
+ (t (format nil "~Af.png" icon-base)))
+ :alt
+ (case (car entry)
+ (:dir "[DIR]")
+ (:text "[TXT]")
+ (t "[FIL]"))))))
+ " "
+ (write-name-link stream (second entry) (third entry))
+ " "
+ (:princ (universal-time-to-apache-date (fourth entry)))
+ (:princ
+ (cond
+ ((or (eq :dir (first entry))
+ (null (fifth entry)))
+ " -")
+ ((< (fifth entry) (* 1024 1024))
+ (format nil "~5,' Dk" (round (fifth entry) 1024)))
+ ((< (fifth entry) (* 1024 1024 1024))
+ (format nil "~5,' Dm" (round (fifth entry) (* 1024 1024))))
+ (t
+ (format nil "~5,' Dg" (round (fifth entry) (* 1024 1024 1024))))
+ ))
+ " "
+ (:princ
+ (if (sixth entry)
+ (sixth entry)
+ ""))
+ :newline)))