aboutsummaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-11-20 22:06:34 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2020-11-20 22:06:40 +0100
commit41667bcfe33cb16da7cbd09b9b7d59f7e957bb88 (patch)
tree66041f282898927f61f5d72f62298f5fe5bb862a /module
parentSlightly improve 'Building <events>' print. (diff)
downloadcalp-41667bcfe33cb16da7cbd09b9b7d59f7e957bb88.tar.gz
calp-41667bcfe33cb16da7cbd09b9b7d59f7e957bb88.tar.xz
Add preliminary component for input-plus-minus.
Diffstat (limited to 'module')
-rw-r--r--module/calp/html/components.scm23
1 files changed, 23 insertions, 0 deletions
diff --git a/module/calp/html/components.scm b/module/calp/html/components.scm
index 03e1cef1..816975e7 100644
--- a/module/calp/html/components.scm
+++ b/module/calp/html/components.scm
@@ -175,3 +175,26 @@
(rel "alternate stylesheet")
(href ,path)
,@extra-attributes)))
+
+
+(define-public (input-plus-minus positive?)
+ (define id (gensym "id"))
+ `(span (@ (class "input-timespan"))
+ (input (@ (type "checkbox")
+ (style "display:none")
+ (class "plusminuscheck")
+ ,@(if positive? '((checked)) '())
+ (id ,id)))
+ (label
+ (@ (for ,id))
+ (span (@ (class "plus")) "+")
+ (span (@ (class "minus")) "-"))))
+
+;; (define-once timespan-generator-id (gensym "timespan-generator"))
+;; (define-public (input-timespan-generator)
+;; `((div (@ (class "template")
+;; (id ,timespan-generator-id))
+;; ,(input-timespan))
+;; (script
+;; "function make_timespan_input() {\n"
+;; "return document.getElementsById(" ,timespan-generator-id ").cloneNode(true);")))