Extract eliss-hidden-input
This commit is contained in:
parent
49639ee0ee
commit
4a35a88c78
1 changed files with 17 additions and 10 deletions
27
eliss.el
27
eliss.el
|
@ -84,6 +84,18 @@ certain other properties.
|
|||
`((placeholder ,placeholder)))
|
||||
,@(when default `((value ,default)))))))))
|
||||
|
||||
(defun eliss-hidden-input (name &rest plist)
|
||||
"Create a input with type hidden.
|
||||
|
||||
Give it the name NAME and take some other properties from
|
||||
proprety list PLIST:
|
||||
|
||||
- `:value' specifies the value attribute the input should get."
|
||||
(let ((value (plist-get plist :value)))
|
||||
`(input (@ (type "hidden")
|
||||
(name ,name)
|
||||
,@(when value `((value ,value)))))))
|
||||
|
||||
(defun eliss-project-page (httpcon)
|
||||
"Send a list of issues and an issue-creation form over HTTPCON."
|
||||
(let* ((project (match-string 1 (elnode-http-mapping httpcon)))
|
||||
|
@ -123,11 +135,8 @@ certain other properties.
|
|||
,(eliss-control-group
|
||||
"email" "Email"
|
||||
:placeholder "john@example.com")
|
||||
(input (@ (type "hidden")
|
||||
(name "i-m-human")
|
||||
(value "t")))
|
||||
(input (@ (type "hidden")
|
||||
(name "i-r-bot")))
|
||||
,(eliss-hidden-input "i-m-human" :value "t")
|
||||
,(eliss-hidden-input "i-r-bot")
|
||||
(input (@ (type "submit")
|
||||
(value "Complain")
|
||||
(class "pull-right"))))
|
||||
|
@ -196,11 +205,9 @@ certain other properties.
|
|||
"email" "Email"
|
||||
:placeholder "john@example.com"
|
||||
:required t)
|
||||
(input (@ (type "hidden")
|
||||
(name "i-m-human")
|
||||
(value "t")))
|
||||
(input (@ (type "hidden")
|
||||
(name "i-r-bot")))
|
||||
,(eliss-hidden-input "i-m-human"
|
||||
:value "t")
|
||||
,(eliss-hidden-input "i-r-bot")
|
||||
(input (@ (type "submit")
|
||||
(value "Comment")
|
||||
(class "pull-right"))))
|
||||
|
|
Loading…
Reference in a new issue