Add with-list-group* alternative
This commit is contained in:
parent
e2936d013c
commit
ed1987691b
1 changed files with 12 additions and 3 deletions
|
@ -22,7 +22,8 @@
|
|||
(:export
|
||||
#:item
|
||||
#:list-group
|
||||
#:with-list-group)
|
||||
#:with-list-group
|
||||
#:with-list-group*)
|
||||
(:documentation "A Common Lisp package for generating Bootstrap List Group components."))
|
||||
|
||||
(in-package :ml-sbt/list-group)
|
||||
|
@ -85,5 +86,13 @@ ITEMS: A list of items to be included in the list group."
|
|||
;; FUCK YOU COMMON LISP! I really don't understand how this works. :(
|
||||
;; If you are able to understand it, and able to explain it to me, please send me an email:
|
||||
;; marcus.kammer@mailbox.org
|
||||
`((loop :for item :in ,items
|
||||
:do (:li :class "list-group-item" item))))))))
|
||||
`((dolist (item ,items)
|
||||
(:li :class "list-group-item" item))))))))
|
||||
|
||||
(defmacro with-list-group* (flush items)
|
||||
(let ((class-str (format nil "list-group~@[ list-group-flush~]" flush)))
|
||||
`(spinneret:with-html
|
||||
(:ul :class ,class-str
|
||||
,@(progn
|
||||
`((dolist (item ,items)
|
||||
(:li :class "list-group-item" item))))))))
|
||||
|
|
Loading…
Add table
Reference in a new issue