aboutsummaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
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);")))