Be able to recognise input type combo in form macro

This commit is contained in:
Marcus Kammer 2024-04-23 19:10:17 +02:00
parent 7817a642de
commit 717035bb51

View file

@ -492,8 +492,7 @@ Example 2:
(method (or (getf attr :method) "post")) (method (or (getf attr :method) "post"))
(list-style-type (or (getf attr :list-style-type) nil))) (list-style-type (or (getf attr :list-style-type) nil)))
`(spinneret:with-html `(root (:class ,class :action ,action :method ,method)
(root (:class ,class :action ,action :method ,method)
,@(loop for q in body ,@(loop for q in body
;; (:ask "" :group "" :choices ()) ;; (:ask "" :group "" :choices ())
@ -505,9 +504,11 @@ Example 2:
;; (:radio "" :text) -> ((:radio "") (:text "")) ;; (:radio "" :text) -> ((:radio "") (:text ""))
for (type values) = (multiple-value-list (resolve-input-and-choice choice)) for (type values) = (multiple-value-list (resolve-input-and-choice choice))
collect `(progn collect `(progn
,(if (string= type "combo")
,@(loop for value in values `(:li (:select ,@(loop for value in values
collect `(:li (apply-input-form ,type ,group ,value)))))))) collect `(:option ,value))))
`(progn ,@(loop for value in values
collect `(:li (apply-input-form ,type ,group ,value))))))))))
(btn-primary (:type "submit") (btn-primary (:type "submit")
(find-l10n "submit" spinneret:*html-lang* *l10n*)))))) (find-l10n "submit" spinneret:*html-lang* *l10n*)))))