summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-05-19 03:16:56 +0200
committerGravatar Tom Willemse2013-05-19 03:16:56 +0200
commit4a35a88c782a63b180e6c538ea773c9d1df354ad (patch)
treea5f09ea30055827427e8637a0b901439183bde8e
parent49639ee0ee1426f074a5bc0ad759ca2920fa422b (diff)
downloadeliss-master.tar.gz
eliss-master.zip
Extract eliss-hidden-inputHEADmaster
-rw-r--r--eliss.el27
1 files changed, 17 insertions, 10 deletions
diff --git a/eliss.el b/eliss.el
index 31f9652..aadc35d 100644
--- a/eliss.el
+++ b/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"))))