Set specific condition for hidden
form ctrl and align naming
This commit is contained in:
parent
91b11dd920
commit
c932c338fa
1 changed files with 19 additions and 16 deletions
|
@ -173,36 +173,39 @@ LABEL: The label to display next to the control."
|
||||||
(id-str (build-str-id name label)))
|
(id-str (build-str-id name label)))
|
||||||
(spinneret:with-html
|
(spinneret:with-html
|
||||||
(:comment (format nil "FORM/CTRL ~A ~A" type name))
|
(:comment (format nil "FORM/CTRL ~A ~A" type name))
|
||||||
(:div :class (spacing :property "m" :side "b" :size 3)
|
(if (string= type "hidden")
|
||||||
(:label :class class-str
|
(:input :class "form-control"
|
||||||
:for id-str
|
:id id-str
|
||||||
label)
|
:type type
|
||||||
(:input :class "form-control"
|
:name name-str
|
||||||
:id id-str
|
:value label)
|
||||||
:type type
|
(:div :class (spacing :property "m" :side "b" :size 3)
|
||||||
:name name-str)))))
|
(:label :class class-str
|
||||||
|
:for id-str
|
||||||
|
label)
|
||||||
|
(:input :class "form-control"
|
||||||
|
:id id-str
|
||||||
|
:type type
|
||||||
|
:name name-str))))))
|
||||||
|
|
||||||
(defmacro define-ctrl (type)
|
(defmacro define-ctrl (type)
|
||||||
"Generates a checkable function based on the provided type.
|
"Generates a checkable function based on the provided type.
|
||||||
|
|
||||||
TYPE: A string representing checkable-element."
|
TYPE: A string representing checkable-element."
|
||||||
(let ((func-name (intern (string-upcase (concatenate 'string "ctrl-" type)))))
|
(let ((func-name (intern (string-upcase (concatenate 'string "ctrl-" type)))))
|
||||||
`(defun ,func-name (name value)
|
`(defun ,func-name (name label)
|
||||||
(ctrl ,type name value))))
|
(ctrl ,type name label))))
|
||||||
|
|
||||||
(defmacro define-ctrls ()
|
(defmacro define-ctrls (&rest types)
|
||||||
"Generates multiple checkable functions based on the provided list of types.
|
"Generates multiple checkable functions based on the provided list of types.
|
||||||
|
|
||||||
TYPES: A list of strings that specifies the types for which to generate
|
TYPES: A list of strings that specifies the types for which to generate
|
||||||
checkable macros."
|
checkable macros."
|
||||||
`(progn
|
`(progn
|
||||||
,@(loop for type in '("button" "checkbox" "color" "date" "datetime-local"
|
,@(loop for type in types
|
||||||
"email" "file" "hidden" "image" "month" "number"
|
|
||||||
"password" "radio" "range" "reset" "search" "submit"
|
|
||||||
"tel" "text" "time" "url" "week")
|
|
||||||
collect `(define-ctrl ,type))))
|
collect `(define-ctrl ,type))))
|
||||||
|
|
||||||
(define-ctrls)
|
(define-ctrls "button" "checkbox" "color" "date" "datetime-local" "email" "file" "hidden" "image" "month" "number" "password" "radio" "range" "reset" "search" "submit" "tel" "text" "time" "url" "week")
|
||||||
|
|
||||||
;;; combo
|
;;; combo
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue