|
|
|
@ -60,5 +60,24 @@
|
|
|
|
|
;; - 0 => false |
|
|
|
|
;; - 1 => true. |
|
|
|
|
;; In this case, if the `VALUE' is not 1, it is always false (I.E. 0). |
|
|
|
|
(djula::def-filter :integer-to-checkbox (value) |
|
|
|
|
(djula:def-filter :integer-to-checkbox (value) |
|
|
|
|
(format nil "~S" (if (= 1 value) "on" "off"))) |
|
|
|
|
|
|
|
|
|
(djula:def-filter :build-thumbnail-path (file) |
|
|
|
|
(cond ((str:contains? "image" (files::file-type-of file) :ignore-case t) |
|
|
|
|
(format nil "/storage/thumb/~a" (files::slug-of file))) |
|
|
|
|
((str:contains? "pdf" (files::file-type-of file) :ignore-case t) |
|
|
|
|
(format nil "/images/icons/pdf.png")) |
|
|
|
|
((str:contains? "html" (files::file-type-of file) :ignore-case t) |
|
|
|
|
(format nil "/images/icons/code.png")) |
|
|
|
|
((str:contains? "text" (files::file-type-of file) :ignore-case t) |
|
|
|
|
(format nil "/images/icons/txt.png")) |
|
|
|
|
((str:contains? "css" (files::file-type-of file) :ignore-case t) |
|
|
|
|
(format nil "/images/icons/code2.png")) |
|
|
|
|
((str:contains? "video" (files::file-type-of file) :ignore-case t) |
|
|
|
|
(format nil "/images/icons/video.png")) |
|
|
|
|
((str:contains? "audio" (files::file-type-of file) :ignore-case t) |
|
|
|
|
(format nil "/images/icons/audio.png")) |
|
|
|
|
((str:contains? "zip" (files::file-type-of file) :ignore-case t) |
|
|
|
|
(format nil "/images/icons/archive.png")) |
|
|
|
|
(t (format nil "/images/icons/file.png")))) |
|
|
|
|