aboutsummaryrefslogtreecommitdiff
path: root/module/output/html.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-07-08 00:01:13 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-07-08 00:01:13 +0200
commit0bdec52cbf4c563bf08791fcd447fcfe6d1ec349 (patch)
tree2a7475b0b5b338e5b875304f3627ca682dc558fc /module/output/html.scm
parentRemove faulty top error handler from main. (diff)
parentDraft of multiple tabs for HTML popups. (diff)
downloadcalp-0bdec52cbf4c563bf08791fcd447fcfe6d1ec349.tar.gz
calp-0bdec52cbf4c563bf08791fcd447fcfe6d1ec349.tar.xz
Merge branch 'html-popup-tabs'
Firefox decided to work again. It might just be my system that it slightly unstable?
Diffstat (limited to 'module/output/html.scm')
-rw-r--r--module/output/html.scm21
1 files changed, 17 insertions, 4 deletions
diff --git a/module/output/html.scm b/module/output/html.scm
index 3e9f71e6..5b06fe01 100644
--- a/module/output/html.scm
+++ b/module/output/html.scm
@@ -142,6 +142,18 @@
(div ,body))))
+(define (tabset elements)
+ (define tabgroup (symbol->string (gensym "tabgroup")))
+
+ `(div (@ (class "tabgroup"))
+ ,@(for (i (key body)) in (enumerate elements)
+ (define id (symbol->string (gensym "tab")))
+ `(div (@ (class "tab"))
+ (input (@ (type "radio") (id ,id) (name ,tabgroup)
+ ,@(when (zero? i) '((checked)))))
+ (label (@ (for ,id) (style "top: " ,(* 6 i) "ex")) ,key)
+ (div (@ (class "content")) ,body)))))
+
(define (popup ev id)
`(div (@ (class "popup-container") (id ,id))
(div (@ (class "popup"))
@@ -156,7 +168,11 @@
title: "Ladda ner"
href: (string-append "/calendar/" (prop ev 'UID) ".ics")))
- ,(fmt-single-event ev))))
+ ,(tabset
+ `(("📅" ,(fmt-single-event ev))
+ ;; TODO only on debug/edit?
+ ("</>" (script (@ (type "application/calendar+xml"))
+ ,((@ (output xcal) vcomponent->sxcal) ev))))))))
@@ -202,9 +218,6 @@
(eq? 'TENTATIVE (prop ev 'PARTSTAT)))
" tentative"))
(data-tipped-options ,(format #f "inline: '~a'" popup-id)))))
- ,(when (debug)
- `(script (@ (type "application/calendar+xml"))
- ,((@ (output xcal) vcomponent->sxcal) ev)))
,(when (prop ev 'RRULE)
`(span (@ (class "repeating")) "↺"))
,((get-config 'summary-filter) ev (prop ev 'SUMMARY))